Im\' getting an error when deploying an artifact in my own repository in a Nexus server: \"Failed to deploy artifacts: Could not transfer artifact\" \"Failed to transfer fil
Ensure that not exists already (artifact and version) in nexus (as release). In that case return Bad Request.
In the rare event that you need to redeploy the SAME STABLE artifact to Nexus, it will fail by default. If you then delete the artifact from Nexus (via the web interface) for the purpose of deploying it again, the deploy will still fail, since just removing the e.g. jar or pom does not clear other files still laying around in the directory. You need to log onto the box and delete the directory in its entirety.
Just to create a separate answer. The answer is actually found in a comment for the accepted answer.
Try changing the version of your artefact to end with -SNAPSHOT
.
A couple things I can think of:
Check those and if you still run into trouble provide more details here.
If any of the above answers worked out, You can create new artifact directly from the admin side of (NEXUS Screen shot attached below).
Login to nexus
UI http://YOUR_URL:8081/nexus( username: admin
default password: admin123 )Click repositories
on the left side then click the repo, For eg: click release.artifact Upload
(last tab). GAV definition
as GAV Param
- Then enter your groupid , artifact id and version .Now you will be able to add the corrsponding in your project.(screenshot below)
Cause of problem for me was -source.jars was getting uploaded twice (with maven-source-plugin) as mentioned as one of the cause in accepted answer. Redirecting to answer that I referred: Maven release plugin fails : source artifacts getting deployed twice