首页 > Windows开发 > 详细

【随手记录】关于 The following classes could not be excluded because they are not auto-configuration classes

时间:2019-04-25 19:21:18      阅读:1865      评论:0      收藏:0      [点我收藏+]

用@SpringBootApplication(exclude = RibbonRule.class)排除类@bean注入的类的时候报错

The following classes could not be excluded because they are not auto-configuration classes.....

stackoverflow  和 spring 的issue 找到了答案,@SpringBootApplication的exclude  专门用来排除auto-configuration 也就是我们说的自动配置的类的,

技术分享图片

如果我们想排除自己定义的@Bean,可以用 @ComponentScan(excludeFilters= {@ComponentScan.Filter(type=FilterType.ANNOTATION, value= {AvoidScan.class})})

【随手记录】关于 The following classes could not be excluded because they are not auto-configuration classes

原文:https://www.cnblogs.com/whaleX/p/10770303.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!