Add support for beans{} in CLI scripts
User can add (a single) beans{} DSL declaration (see GroovyBeanDefinitionReader
in Spring 4 for more detail) anywhere at the top level of an application source
file. It will be compiled to a closure and fed in to the application context
through a GroovyBeanDefinitionReader. Cool!
The example spring-boot-cli/samples/beans.groovy runs in an integration test
and passes (see SampleIntegrationTests).
This commit is contained in:
13
spring-boot-cli/samples/beans.groovy
Normal file
13
spring-boot-cli/samples/beans.groovy
Normal file
@@ -0,0 +1,13 @@
|
||||
@RestController
|
||||
class Application {
|
||||
@Autowired
|
||||
String foo
|
||||
@RequestMapping("/")
|
||||
String home() {
|
||||
"Hello ${foo}!"
|
||||
}
|
||||
}
|
||||
|
||||
beans {
|
||||
foo String, "World"
|
||||
}
|
||||
Reference in New Issue
Block a user