错误信息:
[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中选择项目,右键选择
选择这个后会出现依赖树状图,红色的部分为冲突部分