第一个坑:webflux 项目不能正常使用 feign
网上有替换方案,我是直接改成web使用。
<dependency>
<groupId>org.springframework.boot</groupId>
<!--<artifactId>spring-boot-starter-webflux</artifactId>-->
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
第二个坑:跨包使用 feign,出现使用的时候类是 null 的情况。
解决方式在@EnableFeignClients后面添加报路径,我只直接指到了最终包路径上面了。
@EnableFeignClients(basePackages = {"com.xxxxx.xxxxx.xxxxx.xxxx"})
public class Startup {
public static void main(String[] args) {
SpringApplication.run(Startup.class, args);
}
}
第三个坑:使用@ComponentScan(value = {"com.xx.xx.xxx.xx"})解决跨包问题会出现api不好使,然后我的解决方式是直接干掉标签....