| 维度 | 本地代码(Controller、Service) | Starter 依赖 |
| 加载机制 | @ComponentScan 扫描 |
@EnableAutoConfiguration 自动装配 |
| 核心类 | ClassPathBeanDefinitionScanner |
AutoConfigurationImportSelector |
| 配置文件 | 不需要 | spring.factories(2.x)/ AutoConfiguration.imports(3.x) |
| 过滤方式 | 检查类上是否有 @Component 等注解 |
检查 @ConditionalOnClass 等条件注解 |
| 扫描范围 | 主类所在包及子包 | classpath 下所有 jar 包 |
作为springboot 加载过程的补充。
仅供参考