@compnentscan扫描哪些
时间: 2024-01-21 08:05:03 浏览: 9
@compnentscan 扫描了以下内容:
1. 类上的注解:@Component, @Service, @Controller, @Repository 等
2. 类上的自定义注解,如果这些注解被 @ComponentScan 扫描到了
3. 类上的泛型注解,如 @ComponentScan(basePackageClasses = MyService.class)
4. 类上的元注解,如 @Configuration, @ComponentScan
5. 类上的注解元数据,如 @ComponentScan("com.example"),其中 "com.example" 是扫描的基础包路径
6. 类上的注解属性值,如 @ComponentScan(basePackages = {"com.example", "com.another.example"}),扫描的基础包路径是 "com.example" 和 "com.another.example"
7. 类上的注解属性引用,如 @ComponentScan(basePackageClasses = {MyService.class, AnotherService.class}),扫描的基础包路径是 MyService.class 和 AnotherService.class 所在的包路径
请注意,这只是对 @ComponentScan 注解的一般情况描述,具体的扫描内容还取决于你在应用程序中如何使用 @ComponentScan 注解。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)