首页 > 解决方案 > Maven 部署因冲突而失败

问题描述

我尝试了以下 Maven 命令,

 - mvn clean install
 - mvn clean package
 - mvn clean deploy

前两个成功,但是,最后一个(部署)失败并出现以下错误消息。对此的任何建议都会有所帮助

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project blkmessenger-parent: Failed to deploy artifacts: Could not transfer artifact com.jd.terf:blkmessenger-parent:pom:1.10.0-RC1-20190627.131740-1 from/to blkmessenger.snapshots (http://jd.artifactory.net:8081/artifactory/blkmessenger/snapshots): Failed to transfer file: http://jd.artifactory.net:8081/artifactory/blkmessenger/snapshots/com/jd/terf/blkmessenger-parent/1.10.0-RC1-SNAPSHOT/blkmessenger-parent-1.10.0-RC1-20190627.131740-1.pom. Return code is: 409, ReasonPhrase: Conflict. -> [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

标签: mavendeploymentartifactory

解决方案


Artifactory 在部署时会返回 409 错误有几个原因:

  1. 将快照版本部署到不允许快照的存储库 - 处理快照设置为 false
  2. 将 Release 版本部署到不允许发布的存储库 - Handle Releases 设置为 false
  3. 校验和策略设置为“根据客户端校验和验证”并且客户端已发送校验和,但它与服务器上计算的校验和相冲突,然后是 Artifactory
  4. Suppress POM Consistency设置为 true 且 POM 内部的 groupId:artifactId:version 信息与部署路径不匹配
  5. 由于某些原因,用户插件可能会决定返回 409 错误

推荐阅读