Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nexus accepts upload but says it failed

Tags:

java

maven

nexus

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.

like image 749
Rob Johansen Avatar asked Sep 23 '14 19:09

Rob Johansen


1 Answers

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 : better late than never ;)

like image 164
Jean-Rémy Revy Avatar answered Oct 14 '22 03:10

Jean-Rémy Revy