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); } }