springboot注解扫描

默认扫描MainApplication类所在的包中的类及其子包

 

@SpringBootApplication等同于
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan()
所以如果有自己设置扫描包的需求可以改变ComponentScan注解
posted @ 2022-03-16 12:58  dronff  阅读(408)  评论(0)    收藏  举报