Go work today encountered a problem:
spring-main-dependent spring-aaa (springboot start item)
, You can not get from the container in spring-aaa project with @component comments bean. (Not autowired)
Thinking is definitely spring-aaa in the bean when maven import spring-main, not all of the bean are loaded into the spring-main container.
All springboot start the project, the class will be defined in the configuration xxxAutoConfigeration
Then configure the type of write to the key-value spring.factories manner.
spring-main-dependent time, when springboot start, it will all depend on to call the project spring.factories configuration class.
Then bean configuration related to the spring-main vessel.
Solution: According to the above ideas, will @component comments bean, to put it another way. Write @bean manner class configuration xxxAutoConfigeration