@import 是将配置类添加到另一个配置类中。
http://docs.spring.io/spring-
javaconfig/docs/1.0.0.M4/reference/html/ch04s03.html
@ComponentScan 将扫描代码中声明的组件,例如@ Service,@ Component,@ Repository等。
http://docs.spring.io/spring-
javaconfig/docs/1.0.0.M4/reference/html/ch06s02.html
我认为您需要在配置类中添加@ComponentScan,以便它可以使用您的组件类扫描软件包。
@Configuration@ComponentScan(value = "org.foo.path.baseFolder")public class MyConfiguration { @Autowired protected GlobalPropertiesLoader globalPropertiesLoader;


