Nexus接受上传,但表示失败了 [英] Nexus accepts upload but says it failed

查看:597
本文介绍了Nexus接受上传,但表示失败了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在父POM上执行 mvn release:perform 时,服务器正在响应有关其中一个子项目的错误(文件名已编辑):

When I execute mvn release:perform on a parent POM, the server is responding with this error about one of the child projects (filenames redacted):


[错误]无法执行目标
org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file $ b项目上的$ b(default-cli):无法部署工件:
无法从/向存储库传输工件:无法传输文件。
返回代码是:400,ReasonPhrase:错误请求。

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project: Failed to deploy artifacts: Could not transfer artifact from/to repository: Failed to transfer file. Return code is: 400, ReasonPhrase: Bad Request.

但是,此子项目的所有文件 已成功上传!我看到一个新目录(以发布版本号命名),它包含了人们期望的所有.jar,.pom,.md5和.sha1文件。

However, all the files for this child project are successfully uploaded! I see a new directory (named after the release version number) and it contains all the .jar, .pom, .md5, and .sha1 files one would expect.

我无法访问Nexus服务器,但我想知道是什么原因造成的,以及如何解决它。是否有可能Maven试图两次上传这个特定的子项目?如果是这样,为什么Maven会这样做?我怎么能阻止它?

I don't have access to the Nexus server, but I'm wondering what might cause this and how to fix it. Is it possible that Maven is trying to upload this particular child project twice? If so, why would Maven be doing this and how can I stop it?

更新:如果您遇到同样的问题,请检查用这篇文章中最热门的答案给出答案。我运行 mvn help:effective-pom ,发现有问题的项目实际上有两次部署阶段的执行。删除其中一个执行解决了我的问题。

UPDATE: If you're having the same problem, check out the answer with the most upvotes in this post. I ran mvn help:effective-pom and found that the project in question actually had two executions of the deploy phase. Removing one of those executions solved my problem.

推荐答案

我遇到了同样的问题,发布了 maven 多模块项目。第一次发生错误,但部署目标已经联系 nexus 然后创建适当的路径。假设释放回购是一次性写入,第二次我将其复制,拒绝覆盖路径。

I encountered the same issue, releasing a maven multi-module project. An error occured the first time but the deploy goal had already contact nexus and then create the appropriate path. Assuming that a "release" repo is a write-once one, the second time I trggered it, nexus refuse to overwrite the path.

因此,在这种情况下,您可能会要求管理员删除回购..或者创建一个新版本。

So, in such a case, you might ask your admin to delete the repo ... or create a new release.

PS:迟到总比没有好;)

PS : better late than never ;)

这篇关于Nexus接受上传,但表示失败了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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