自定义springboot-starter注意事项
文章目录
注意引用方的ComponentScan
springboot默认scan的包名是其main类所在的包名。如果引入的starter包名不一样,需要自己添加scan。
@ComponentScan(basePackages = {"com.xixicat.demo","com.xixicat.sms"})
对于starter中有feign的,需要额外指定
@EnableFeignClients(basePackages = {"com.xixicat.sms"})
对于exclude一些autoConfig
@EnableAutoConfiguration(exclude = {MetricFilterAutoConfiguration.class})
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论