spring扫描路径与排除路径
application.java中加入:
@SpringBootApplication @ComponentScan(basePackages = {"com.xx"}, excludeFilters = {@ComponentScan.Filter(type = FilterType.REGEX, pattern = "com.xx.subxx.*")})
表示扫描com.xx但不扫描com.xx.subxx
上面如果加个DependsOn("beanName")表示先加载"beanName"这个bean,再加载本实例,如:
@SpringBootApplication @DependsOn("cacheManager")
关闭spring对actuate的监控
#关闭elasticsearch健康检查 management: health: elasticsearch: enabled: false
相关阅读
评论:
↓ 广告开始-头部带绿为生活 ↓
↑ 广告结束-尾部支持多点击 ↑