springboot项目需要在启动时候扫描bean时排除一些不需要的bean,在启动注解上添加exclude属性启动时报错
The following classes could not be excluded because they are not auto-configuration classes:XXXXXXXX
原因是@SpringBootApplication的exclude只可以排除spring自动配置的bean。如果需要排除自定义的bean,可以改成
@ComponentScan(excludeFilters{@ComponentScan.Filter(type=FilterType.ANNOTATION, value= {XXXXXXX.class})})