gpt4 book ai didi

maven部署:deploy-file fails (409 Conflict),但 Artifact 上传成功

转载 作者:行者123 更新时间:2023-12-03 07:38:39 25 4
gpt4 key购买 nike

NOTE:

I now realize that the jar got placed into my repository, but the pom.xml did not. Now, I have another project where the pom.xml fails to get promoted, but the jar is placed in the repository.

However, another project, both the pom.xml and the jar do get placed in the repository.

<小时/>

我在 Jenkins 中有一个项目,我使用升级插件通过 deploy:deploy-file 目标在 Maven 中部署我的 Artifact 。

这适用于我在 Maven 中拥有的其他几个项目,但对于这个项目却失败了。有趣的是文件(但不是 pom.xml)无论如何都会上传。我通过从 Maven 存储库中删除该 Artifact ,然后运行升级来验证了这一点。升级后,该 Artifact 位于我们的存储库中。

这是我收到的日志。尽我所能打破超长的线条:

[workspace] $ /bin/bash -xe /opt/tomcat/apache-tomcat-7.0.27/temp/hudson7357923598740079329.sh
+ FILE_LOC=/mnt/jenkins/builds/metricsdb-trunk/21/archive/target/archive
+ mvn deploy:deploy-file
-Dversion=0.8.0
-Dfile=/mnt/jenkins/builds/metricsdb-trunk/21/archive/target/archive/metricsdb-etl.jar
-DpomFile=/mnt/jenkins/builds/metricsdb-trunk/21/archive/target/archive/pom.xml
-Durl=http://repo.vegicorp.com/artifactory/ext-release-local -DrepositoryId=VegiCorp
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Command Line Spring Batch Module 0.8.0.CI-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy-file (default-cli) @ metricsdb-etl ---
Uploading: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.jar
2/38 KB
4/38 KB
[...]

Uploaded: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.jar (38 KB at 202.2 KB/sec)
Uploading: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.pom
2/7 KB
4/7 KB
[...]

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.243s
[INFO] Finished at: Thu Oct 04 14:38:52 CDT 2012
[INFO] Final Memory: 4M/119M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file
(default-cli) on project metricsdb-etl: Failed to deploy artifacts:
Could not transfer artifact com.vegicorp.batch.metricsdb:metricsdb-etl:pom:0.8.0 from/to
VegiCorp (http://repo.vegicorp.com/artifactory/ext-release-local):
Failed to transfer file: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.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
failed build hudson.tasks.Shell@24a6e7f9 SUCCESS
Finished: FAILURE

带有调试标志 (-X) 的输出位于 Pastebin .

最佳答案

我发现了问题。实际上有两个问题:

  • 我只设置了发布存储库,并且尝试在发布存储库中保存快照版本。 Artifactory 设置为仅允许发布存储库中的发布。这可以在 Artifactory 设置中修改,但我决定不这样做。

  • 我的 pom.xml 中的版本与我尝试保存的版本不同。例如,pom.xml 表示版本 2.0,而我试图将版本保存为 2.0.2。由于这个原因,Artifactory 拒绝了 pom(但不是 jar)。

我发现 Artifactory 设置(针对每个存储库)询问是否“抑制 POM 一致性检查”。选中此框将允许我将版本设置为一个,但让 pom 设置为另一个版本。

我还必须修改我的 Maven“settings.xml”文件以允许发布和快照存储库。我还必须修改快照存储库的 URL。

我们只使用 Ivy 一段时间(它没有快照概念),因此我们只是将内容放入发布存储库中。这是一个Maven项目,开发者在POM中将版本标记为SNAPSHOT。

不幸的是,Maven 文档相当糟糕,并且仍然没有任何关于 Maven 的好书。更糟糕的是,错误消息实在是太糟糕了。 “409, ReasonPhrase:Conflict.-> [Help 1]”是什么意思?

并不是说 Ivy 文档好得多,而是Ant in Action有一些关于使用 Ivy 的精彩部分。

关于maven部署:deploy-file fails (409 Conflict),但 Artifact 上传成功,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12734788/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com