我尝试做一个mvn dependency:tree
,我得到了一棵依赖树。
我的问题是,我的项目依赖于许多模块,而这些模块内部依赖于许多弹簧构件。有一些版本冲突。我想升级所有与Spring相关的库,以说最新的库(2.6.x或更高版本)。首选的方法是什么?
我应该在pom.xml中声明所有deps spring-context,spring-support(以及其他10个工件)并将它们指向2.6.x吗?还有其他更好的方法吗?
[INFO] +- com.xxxx:yyy-jar:jar:1.0-SNAPSHOT:compile
[INFO] | +- com.xxxx:zzz-commons:jar:1.0-SNAPSHOT:compile
[INFO] | | +- org.springframework:spring-dao:jar:2.0.7:compile
[INFO] | | +- org.springframework:spring-jdbc:jar:2.0.7:compile
[INFO] | | +- org.springframework:spring-web:jar:2.0.7:compile
[INFO] | | +- org.springframework:spring-support:jar:2.0.7:compile
[INFO] | | +- net.sf.ehcache:ehcache:jar:1.2:compile
[INFO] | | +- commons-collections:commons-collections:jar:3.2:compile
[INFO] | | +- aspectj:aspectjweaver:jar:1.5.3:compile
[INFO] | | +- betex-commons:betex-commons:jar:5.5.1-2:compile
[INFO] | | \- javax.servlet:servlet-api:jar:2.4:compile
[INFO] | +- org.springframework:spring-beans:jar:2.0.7:compile
[INFO] | +- org.springframework:spring-jmx:jar:2.0.7:compile
[INFO] | +- org.springframework:spring-remoting:jar:2.0.7:compile
[INFO] | +- org.apache.cxf:cxf-rt-core:jar:2.0.2-incubator:compile
[INFO] | | +- org.apache.cxf:cxf-api:jar:2.0.2-incubator:compile
[INFO] | | | +- org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0-M1:compile
[INFO] | | | +- org.codehaus.woodstox:wstx-asl:jar:3.2.1:compile
[INFO] | | | +- org.apache.neethi:neethi:jar:2.0.2:compile
[INFO] | | | \- org.apache.cxf:cxf-common-schemas:jar:2.0.2-incubator:compile
更新:我删除了有关“ \-”的其他问题,所以我的问题现在是主题要求的内容:)
最佳答案
有两种解决方案:
OSS方式:下载您依赖的项目,将其迁移到Spring的最新版本并发送补丁程序,以便每个人都能获得新功能
覆盖您自己的POM中每个依赖项的版本。