maven deploy:deploy-file failed (409 Conflict),但工件上传成功 [英] maven deploy:deploy-file fails (409 Conflict), yet artifact uploads successfully

查看:27
本文介绍了maven deploy:deploy-file failed (409 Conflict),但工件上传成功的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在意识到 jar 已放入我的存储库中,但 pom.xml 没有.现在,我有另一个项目,其中 pom.xml 无法提升,但 jar 已放置在存储库中.

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.

然而,另一个项目,pom.xml 和 jar 都放在存储库中.

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

<小时>

我在 Jenkins 有一个项目,我使用推广插件通​​过 deploy:deploy-file 目标在 Maven 中部署我的工件.


I have a project in Jenkins where I use the promotion plugin to deploy my artifacts in Maven via the deploy:deploy-file goal.

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

This works for several other projects I have in Maven, but it fails for this project. The funny thing is that the file (but not the pom.xml) uploads anyway. I've verified this by removing the artifact from our Maven repository, then running the promotion. The artifact is in our repository after the promotion.

这是我得到的日志.尽我所能打破超长的队伍:

Here's the log I'm getting. Broke up the extra long lines the best I could:

[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 中.

Output with the debug flag (-X) is in Pastebin.

推荐答案

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

I found the problem. Two problems actually:

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

  • I only had the release repository setup, and I was attempting to save a snapshot release in the release repository. Artifactory was setup to only allow releases in the release repository. This can be modified in the Artifactory setting, but I decided against this.

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

My pom.xml has a different version in it than I was trying to save it to. For example, the pom.xml said version 2.0 and I was trying to save the release as 2.0.2. Artifactory rejected the pom (but not the jar) for this reason.

我找到了询问是否禁止 POM 一致性检查"的 Artifactory 设置(每个存储库).选中此框将允许我将版本设置为一个,但让 pom 说另一个.

I found the Artifactory setting (which is per repository) that asks whether or not to "Suppress POM consistency checks". Checking this box will allow me to set the version to one, but have the pom say another.

我还必须修改我的 Mavensettings.xml"文件以允许发布和快照存储库.我还必须修改我指向快照存储库的 URL.

I also had to modify my Maven "settings.xml" file to allow for both a Release and Snapshot repository. I also have to modify my URL to the snapshot repository.

我们只使用了一段时间的 Ivy(它没有 快照 概念),所以我们只是把东西放在发布存储库中.这是一个Maven项目,开发者在POM中将版本标记为SNAPSHOT.

We were only using Ivy for a while (which doesn't have a snapshot concept), so we were just putting stuff in the release repository. This is a Maven project, and the developer marked the version in the POM as a SNAPSHOT.

不幸的是,Maven 文档非常糟糕,而且仍然没有任何关于 Maven 的好书.更糟糕的是,错误消息简直太糟糕了.409, ReasonPhrase:Conflict. -> [Help 1]"是什么意思?

Unfortunately, Maven documentation is pretty poor, and there still aren't any good books on Maven. Even worse is that the error messages are simply poor. What does "409, ReasonPhrase:Conflict. -> [Help 1]" mean?

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

Not that Ivy documentation is so much better, but Ant in Action has some excellent sections on using Ivy.

这篇关于maven deploy:deploy-file failed (409 Conflict),但工件上传成功的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆