【问题标题】:Maven deployment fails with conflictMaven 部署因冲突而失败
【发布时间】:2019-06-27 13:36:18
【问题描述】:

我已经尝试了以下 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

【问题讨论】:

    标签: maven deployment artifactory


    【解决方案1】:

    Artifactory 在部署时返回 409 错误的原因有两个:

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

    【讨论】:

      【解决方案2】:

      确保您的工件存储库允许快照。

      进一步检查你的 groupId、artifact 和 version 的格式是否正确(版本以“-SNAPSHOT”结尾)。

      【讨论】:

      • 我看到存储库设置启用了“Handle Releases”和“Handle Snapshots”,但没有“Suppress POM Consistency Checks”。启用后,部署工作正常。但是想知道它的用途。启用此选项是否有任何潜在影响?您能否对这个选项进行一些说明。
      • POM 中的版本号是否与您尝试部署的版本号不同?您是否有任何 XML 错误或奇怪的符号?也许您可以将您的 POM 添加到问题中?
      • 您想查看父 pom 还是还需要所有子 pom?
      • 这是一个多模块项目吗?
      • 能否添加部署失败的pom?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-05
      • 1970-01-01
      • 2012-10-29
      • 1970-01-01
      • 2017-09-09
      相关资源
      最近更新 更多