Spring boot does not load beans from groovy bean builder -
I am trying to create a simple springboot program that uses the Groove Bean Builder, but I miss something saying:
@EnableAutoConfiguration class MyApplication {public static void main (string [] Arges) {logger.info "Meraalp is starting ..." object [] source = [MyApplication. class, new Wargpath Resources ( "Bibi. groovy")] SpringApplication.run (source, Arges)}} / / MyController.groovy @RestController class MyController {ConfigObject configObject MyService myService @RequestMapping ( "/ home") scheme Ring Home () {myService.getSomeData ()}} // src / main / resources / BB. Groovy beans = {myService (Maiswaiv) {url = "http://www.spring.io"} configObject (ConfigObject) { New ConfigSlurper () Parse ( "Config.groovy")} myController (MyController) {configObject = ref ( 'configObject') myService = ref ( 'myService')}} Springbut starts fine, But I do not see any effort (system out) in the startup to load the beans from BB.V. Groovy.
I know that this answer is possible, but I have some Should be remembered ...
Answering my own question is not a problem with this spring boot Is but With Green DSL syntax.
This configuration will take equal sign {} not beans = {}
Should beans are loading properly I was using resources.groovy of Grails, where syntax beans In addition, for config.groovy injecting, I had to use
new ConfigSlurper ("Config.groovy")
where config .groovy is a file in the same directory as bb.groovy. P> (Ref :)
Comments
Post a Comment