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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM