java Nexus 接受上传但表示失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26003271/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Nexus accepts upload but says it failed
提问by Rob Johansen
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):
当我mvn release:perform
在父 POM 上执行时,服务器响应有关子项目之一的此错误(文件名已编辑):
[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.
[错误] 无法在项目上执行目标 org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli):无法部署工件:无法从/向存储库传输工件:无法传输文件。返回代码为:400,ReasonPhrase:错误请求。
However, all the files for this child project aresuccessfully 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.
但是,该子项目的所有文件都已成功上传!我看到一个新目录(以发布版本号命名),它包含人们期望的所有 .jar、.pom、.md5 和 .sha1 文件。
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?
我无权访问 Nexus 服务器,但我想知道可能导致此问题的原因以及如何解决。Maven 是否有可能尝试两次上传这个特定的子项目?如果是这样,为什么 Maven 会这样做,我该如何阻止它?
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.
更新:如果您遇到同样的问题,请查看这篇文章中获得最多票数的答案。我跑起来mvn help:effective-pom
发现有问题的项目实际上有两次部署阶段的执行。删除其中一个处决解决了我的问题。
回答by Jean-Rémy Revy
I encountered the same issue, releasing a mavenmulti-module project. An error occured the first time but the deploy goal had already contact nexusand then create the appropriate path. Assuming that a "release" repo is a write-once one, the second time I trggered it, nexusrefuse to overwrite the path.
我遇到了同样的问题,发布了一个maven多模块项目。第一次出现错误,但是部署目标已经联系了nexus,然后创建了合适的路径。假设“发布”存储库是一次写入的存储库,第二次触发它时,nexus拒绝覆盖路径。
So, in such a case, you might ask your admin to delete the repo ... or create a new release.
因此,在这种情况下,您可能会要求您的管理员删除 repo ... 或创建一个新版本。
PS : better late than never ;)
PS:迟到总比不到好;)