记录一次spring boot下多模块引用包冲突问题排查

图中,netty模块引用了common模块,编译项目时提示 netty-io 5.0.0.Alpha2 和netty 4.1.31.final冲突。检查common 模块pom文件中并没有引用netty。在common模块下执行maven 依赖树命令:mvn dependency:tree,通过排查依赖树,发现redis中依赖了 netty 4.1.31.final 的 lettuce-core,于是在引用common的时候排除即可。

 1 <dependency>
 2             <groupId>com.leenleda</groupId>
 3             <artifactId>common</artifactId>
 4             <version>0.0.1-SNAPSHOT</version>
 5             <scope>compile</scope>
 6             <exclusions>
 7                 <exclusion>
 8                     <groupId>io.lettuce</groupId>
 9                     <artifactId>lettuce-core</artifactId>
10                 </exclusion>
11             </exclusions>
12 </dependency>
View Code

重新编译,成功执行

原文地址:https://www.cnblogs.com/rolayblog/p/12038199.html