springboot指定注解扫描范围

springboot注解扫描范围是由@ComponentScan指定的;
默认情况下为启动程序所在目录及其子包;

如果需要指定扫描路径,在启动程序中添加修改

@ComponentScan(basePackages={"org.jstudio.a","org.jstudio.b"})
@SpringBootApplication
public class xxxApplication {
    public static void main(String[] args) {
    SpringApplication.run(xxxApplication.class, args);
    }
}

 

posted @ 2019-08-08 11:42  猪脚踏浪  阅读(11709)  评论(0编辑  收藏  举报