netty 排除父pom传递依赖

为了方便管理,让父项目的pom.xml,让子项目继承父项目的依赖

但是有时会造成jar冲突,例如dubbo中引用低版本的Netty的jar,我的子项目使用了spark,spark使用到高版本的netty的jar

parent-pom.xml(引用了dubbo中引用低版本的Netty的jar)

          sencond-parent-pom.xml

                         third-parent-pom.xml

                                 task-pom.xml(使用spark,引用高版本的netty的jar)

解决办法:

重新在       task-pom.xml 引入dubbo依赖,然后再次排除netty即可          


<dependencies>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>2.8.3</version>
<exclusions>
<exclusion>
<artifactId>spring</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>netty</artifactId>
<groupId>org.jboss.netty</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

猜你喜欢

转载自blog.csdn.net/changyuan101/article/details/53464927