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

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

问题描述

我现在意识到这个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.






我在詹金斯有一个项目我使用促销插件通过 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设置中修改,但我决定反对这一点。

  • 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.

我发现了Artifactory设置存储库),询问是否抑制POM一致性检查。检查此框将允许我将版本设置为一个,但是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文件以允许适用于Release和Snapshot存储库。我也必须修改我的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 in Action 有一些使用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),但是artifact上传成功的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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