Spring Support: Automatic configuration by @Import and @ComponentScan ("basePackages"/"basePackageClasses")
#KT-12135 Fixed #KT-12139 Fixed
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
import org.springframework.context.annotation.ComponentScan
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import foo.FooBean
|
||||
import bar.BarBean
|
||||
|
||||
@ComponentScan(basePackageClasses = arrayOf(FooBean::class, BarBean::class))
|
||||
@Configuration
|
||||
open class Config
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package bar
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class BarBean {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
springConfig: ["Config.kt"],
|
||||
file: "foo/beans.kt",
|
||||
icon: "SpringJavaBean",
|
||||
tooltip: "Navigate to the spring bean declaration(s)",
|
||||
naming: "generic",
|
||||
targets: ["Config"]
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package foo
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class Foo<caret>Bean {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import org.springframework.context.annotation.ComponentScan
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
@ComponentScan(basePackages = arrayOf("foo", "bar"))
|
||||
@Configuration
|
||||
open class Config
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package bar
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class BarBean {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
springConfig: ["Config.kt"],
|
||||
file: "foo/beans.kt",
|
||||
icon: "SpringJavaBean",
|
||||
tooltip: "Navigate to the spring bean declaration(s)",
|
||||
naming: "generic",
|
||||
targets: ["Config"]
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package foo
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class Foo<caret>Bean {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import org.springframework.context.annotation.Import
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import baz.Config2
|
||||
|
||||
@Configuration
|
||||
@Import(Config2::class)
|
||||
open class Config
|
||||
@@ -0,0 +1,8 @@
|
||||
package bar
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class BarBean {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package baz
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import foo.FooBean
|
||||
import bar.BarBean
|
||||
|
||||
@ComponentScan(basePackageClasses = arrayOf(FooBean::class, BarBean::class))
|
||||
@Configuration
|
||||
open class Config2
|
||||
@@ -0,0 +1,8 @@
|
||||
package foo
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class Foo<caret>Bean {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
springConfig: ["Config.kt"],
|
||||
file: "foo/beans.kt",
|
||||
icon: "SpringJavaBean",
|
||||
tooltip: "Navigate to the spring bean declaration(s)",
|
||||
naming: "generic",
|
||||
targets: []
|
||||
}
|
||||
Reference in New Issue
Block a user