SpringBoot自动配置原理
1)、SpringBoot启动的时候加载主配置类,开启了自动配置功能
@EnableAutoConfiguration
@EnableAutoConfiguration
作用: 利用EnableAutoConfigurationImportSelector给容器中导入一些组件?
可以查看selectImports()方法的内容;
List configurations = getCandidateConfigurations(annotationMetadata, attributes);获取候选的配置
SpringFactoriesLoader.loadFactoryNames()
扫描所有jar包类路径下 M