@SpringBootConfiguration // [@Configuration ]labeled this is config class
@EnableAutoConfiguration
public @interface SpringBootApplication {
@EnableAutoConfiguration
@AutoConfigurationPackage
// inspect many XXAutoConfiguration class to IOC container, equivalent to xml config info, such as if I use MVC, I have to config ViewResolver by xml in spring etc
@Import(EnableAutoConfigurationImportSelector.class)
public @interface EnableAutoConfiguration {
@AutoConfigurationPackage:
// means <context:component-scan> tag]] auto config package
// import component to container, use AutoConfigurationPackages.Registrar.class to import all the components in the package and subpackages, which contains class marked by
@Import(AutoConfigurationPackages.Registrar.class)
EnableAutoConfigurationImportSelector.class
SpringFactoriesLoader.loadFactoryNames(EnableAutoConfiguration.class,classLoader)
SpringBoot Application starting will load the value of EnableAutoConfiguration from file spring-boot-autoconfigure-1.5.9.RELEASE.jar/META-INF/spring.factories
@AutoConfigurationPackage: