This is authorization issue. Open settings. xml file from folder where maven is installed and correct the user ID and password. It should solve your problem.
Code 400 - Method not Allowed The most common reason is that you are trying to re-deploy an artifact into a repository which does not allow redeployment. Check the "deployment policy" in your hosted repository configuration.
Go to "http://localhost:8081/nexus" Login as user: "admin" password: "admin123" Click on "Browse Repositories," and you'll see a list of repositories. You will want to right click on the "3rd Party" repository and choose "Upload Artifact."
A couple things I can think of:
Check those and if you still run into trouble provide more details here.
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
.
400 Bad Request will be returned if you attempt to:
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
I had this exact problem today and the problem was that the version I was trying to release:perform was already in the Nexus repo.
In my case this was likely due to a network disconnect during an earlier invocation of release:perform. Even though I lost my connection, it appears the release succeeded.
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.
I had the same problem today with the addition "Return code is: 400, ReasonPhrase: Bad Request." which turned out to be the "artifact is already deployed with that version if it is a release" problem from answer above enter link description here
One solution not mentioned yet is to configure Nexus to allow redeployment into a Release repository. Maybe not a best practice, because this is set for a reason, you nevertheless could go to "Access Settings" in your Nexus repositories´ "Configuration"-Tab and set the "Deployment Policy" to "Allow Redeploy".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With