解决spring-data-elasticsearch的netty包冲突

netty4.0后,不再是jboss的一部分,包名从 org.jboss.netty 变更为 io.netty

jar包也被分割成了多个子模块,以便用户可以定制引入需要的子包。当前结构如下:

Artifact IDDescription
netty-parentMaven parent POM
netty-commonUtility classes and logging facade
netty-bufferByteBuf API that replaces java.nio.ByteBuffer
netty-transportChannel API and core transports
netty-transport-rxtxRxtx transport
netty-transport-sctpSCTP transport
netty-transport-udtUDT transport
netty-handlerUseful ChannelHandler implementations
netty-codecCodec framework that helps write an encoder and a decoder
netty-codec-httpCodecs related with HTTP, Web Sockets, SPDY, and RTSP
netty-codec-socksCodecs related with SOCKS protocol
netty-allAll-in-one JAR that combines all artifacts above
netty-tarballTarball distribution
netty-exampleExamples
netty-testsuite-*A collection of integration tests
netty-microbenchMicrobenchmarks

注意:会有一个全包,netty-all

spring-data-elasticsearc3.1.14引用的是netty4的部分子包,而我们的微服务框架引用的是netty-all4.0.3.Final包,这样就产生了冲突,你可能会想,排除spring-data-elasticsearc的所有子包,但是spring-data-elasticsearc使用的netty的版本是4.1.13.Final,比较新的版本,有些方法,在netty-all4.0.3.Final中没有,所以这种方案pass掉,那么可以这样,引用高版本的netty,排除掉子包(单个/所有皆可),一般高版本会兼容低版本的方法,统一使用netty-all4.1.13.Final版本的包,微服务和spring-data-elasticsearc3.1.14都无问题。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值