maven jar包依赖冲突

错误信息:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:33 min
[INFO] Finished at: 2018-01-22T11:04:20+08:00
[INFO] Final Memory: 34M/250M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project market-cleaning: Failed to deploy artifacts: Could not transfer artifact market-cleaning:jar:1.1.0 from/to releases (http://nexus.cbpmgt.com/nexus/content/repositories/releases): Failed to transfer file: http://nexus.cbpmgt.com/nexus/content/repositories/releases/com/market/market-cleaning/1.1.0/market-cleaning-1.1.0.jar. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

查找问题:

在本地执行此命令可以检查Jar包版本冲突:mvn -X compile dependency:tree -Dverbose >a.log,
然后在a.log文件里查找 是否有”omitted for conflict with”,如果有,则表示jar包有版本冲突 ;

查询结果:

INFO] com.market:market-cleaning:jar:1.1.0
[INFO] +- com.market:market-cleaning-api:jar:1.0.0-SNAPSHOT:compile
[INFO] |  \- (com.market:market-common:jar:1.1.6-SNAPSHOT:compile - omitted for conflict with 1.1.7-SNAPSHOT)
[INFO] +- com.market:market-common:jar:1.1.7-SNAPSHOT:compile
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.5:compile
[INFO] +- com.market:market-persistence-config:jar:1.3.1-SNAPSHOT:compile
[INFO] |  +- (com.market:market-common:jar:1.1.6:compile - omitted for conflict with 1.1.7-SNAPSHOT)
[INFO] |  \- org.mybatis:mybatis:jar:3.1.1:compile

方法一:

说明com.market:market-cleaning-api与com.market:market-persistence-config中的com.market:market-common版本存在冲突,去pom里修改他们保持一致

方法二:

idea中下载工具:Maven Helper
点开pom文件:
这里写图片描述
点击Dependency Analyzer可以查看冲突

方法三:

这里写图片描述
idea中maven projects中选择项目,右键选择
这里写图片描述

选择这个后会出现依赖树状图,红色的部分为冲突部分

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值