自定义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})

你可能感兴趣的:(springboot)