详解 maven的pom.xml用<exclusion>解决版本问题
更新时间:2017年09月09日 15:26:49 作者:OK_boom
这篇文章主要介绍了详解 maven的pom.xml用<exclusion>解决版本问题的相关资料,希望通过本文能帮助到大家,需要的朋友可以参考下
详解 maven的pom.xml用<exclusion>解决版本问题
用maven管理库依赖,有个好处就是连同库的依赖的全部jar文件一起下载,免去手工添加的麻烦,但同时也带来了同一个jar会被下载了不同版本的问题,好在pom的配置里面允许用<exclusion>来排除一些不需要同时下载的依赖jar 。
比如配置struts-core,它会同时下载javassist和asm相关的jar,但版本又不够新,这时可以排除它们:
<!-- Struts2 --> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> <version>${struts.version}</version> <exclusions> <exclusion> <groupId>javassist</groupId> <artifactId>javassist</artifactId> </exclusion> <exclusion> <!-- we prefer our explicit version, though it should be the same --> <groupId>asm</groupId> <artifactId>asm</artifactId> </exclusion> <exclusion> <!-- we prefer our explicit version, though it should be the same --> <groupId>asm</groupId> <artifactId>asm-commons</artifactId> </exclusion> <exclusion> <!-- we prefer our explicit version, though it should be the same --> <groupId>org.ow2.asm</groupId> <artifactId>asm</artifactId> </exclusion> <exclusion> <!-- we prefer our explicit version, though it should be the same --> <groupId>org.ow2.asm</groupId> <artifactId>asm-commons</artifactId> </exclusion> </exclusions> </dependency>
如有疑问请留言或者到本站社区交流讨论,希望通过本文能帮助到大家,谢谢大家对本站的支持!
相关文章
单台Spring Cloud Eureka升级到三台Eureka高可用集群
今天小编就为大家分享一篇关于单台Spring Cloud Eureka升级到三台Eureka高可用集群,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧2018-12-12java实现切割wav音频文件的方法详解【附外部jar包下载】
这篇文章主要介绍了java实现切割wav音频文件的方法,结合实例形式详细分析了java切割wav音频文件的相关原理、操作技巧与注意事项,并附带外部jar包供读者下载,需要的朋友可以参考下2019-05-05
最新评论