maven依赖asm,Maven依赖项不在pom.xml中

I have a project which uses spring. It uses version 3.1.1 but, for some reason I really don't know, some spring artifacts are duplicated with two different versions. I look for the those dependencies in all pom.xml files from my project. I also use the dependecy plugin to figure out where were those dependencies included.

Here you have an extract of the output of mvn dependency:tree

[INFO] | | \- org.springframework:spring-web:jar:3.1.1.RELEASE:compile

[INFO] | | +- aopalliance:aopalliance:jar:1.0:compile

[INFO] | | +- org.springframework:spring-beans:jar:3.1.1.RELEASE:compile

[INFO] | | +- org.springframework:spring-context:jar:3.1.1.RELEASE:compile

[INFO] | | | +- org.springframework:spring-aop:jar:3.1.1.RELEASE:compile

[INFO] | | | +- org.springframework:spring-expression:jar:3.1.1.RELEASE:compile

[INFO] | | | \- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile

[INFO] | | \- org.springframework:spring-core:jar:3.0.5.RELEASE:compile

As far as I know this means that org.springframework:spring-core:jar:3.0.5.RELEASE:compile is included in org.springframework:spring-web:jar:3.1.1.RELEASE:compile.

I workaround this including a dependency with scope provided but I'd need to know why is this happening.

Update:

It seems that when I comment the next code the jars are not included in the war.

org.apache.cxf

cxf-rt-frontend-jaxws

${cxf-version}

...

...

2.4.2

3.1.1

解决方案

If i add only the org.springframework:spring-web:jar:3.1.1.RELEASE to a project and show the tree via mvn dependency:tree the following output appears:

[INFO] \- org.springframework:spring-web:jar:3.1.1.RELEASE:compile

[INFO] +- aopalliance:aopalliance:jar:1.0:compile

[INFO] +- org.springframework:spring-beans:jar:3.1.1.RELEASE:compile

[INFO] +- org.springframework:spring-context:jar:3.1.1.RELEASE:compile

[INFO] | +- org.springframework:spring-aop:jar:3.1.1.RELEASE:compile

[INFO] | +- org.springframework:spring-expression:jar:3.1.1.RELEASE:compile

[INFO] | \- org.springframework:spring-asm:jar:3.1.1.RELEASE:compile

[INFO] \- org.springframework:spring-core:jar:3.1.1.RELEASE:compile

[INFO] \- commons-logging:commons-logging:jar:1.1.1:compile

wher never got a reference to org.springframework:spring-core:jar:3.0.5.RELEASE or org.springframework:spring-asm:jar:3.0.5.RELEASE. This means you have an other dependency which introduces that or you are using a dependencyManagement block overwrites that.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值