Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
177 views
in Technique[技术] by (71.8m points)

java - Nexus accepts upload but says it failed

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):

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

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.

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?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I encountered the same issue, releasing a multi-module project. An error occured the first time but the deploy goal had already contact and then create the appropriate path. Assuming that a "release" repo is a write-once one, the second time I trggered it, 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 : better late than never ;)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...