maven - 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
解决方案
Artifactory 在部署时会返回 409 错误有几个原因:
- 将快照版本部署到不允许快照的存储库 - 处理快照设置为 false
- 将 Release 版本部署到不允许发布的存储库 - Handle Releases 设置为 false
- 校验和策略设置为“根据客户端校验和验证”并且客户端已发送校验和,但它与服务器上计算的校验和相冲突,然后是 Artifactory
- Suppress POM Consistency设置为 true 且 POM 内部的 groupId:artifactId:version 信息与部署路径不匹配
- 由于某些原因,用户插件可能会决定返回 409 错误
推荐阅读
- html - 将固定 div 定位在另一个固定 div 内
- objective-c - 未命名(临时、非左值)变量的 Objective-C 版本
- kiwi-tcms - 在公共租户上看不到测试运行/集成项目
- javascript - 如何在 return 语句中映射二维数组?
- android - 获取包含最后一条消息的所有频道的最快方法是什么?
- azure-cosmosdb - 使用 DocumentClient.ReadOfferAsync 获取缩放状态
- node.js - 为什么我的 Mocha 测试(异步/等待)通过但同时抛出错误?
- r - 如何加载具有未知文件类型的 R 工作空间
- websocket - 使用 Kotlin 时是否有适用于 iOS 的 WebSocket 客户端库?
- python - IndexError:列表分配索引超出范围(Python)