Markus Markus - 4 months ago 32
Git Question

jenkins Nexus Artifact Uploader 400

I'm trying to upload my maven project to nexus after a success build on jenkins. Here are my both configurations:


And the jenkins configuration:

Here the error

Failed to deploy artifacts:
Could not transfer artifact de.kuwpatv:NettyCore:pom:1.0-20170508.212447-1 from/to cloud-repo (http://xxx:xxx/nexus/content/repositories/cloud-repo):
Failed to transfer file: http://xxx:xxx/nexus/content/repositories/cloud-repo/de/kuwpatv/NettyCore/1.0-SNAPSHOT/NettyCore-1.0-20170508.212447-1.pom.
Return code is: 400, ReasonPhrase:Bad Request.
ERROR: Uploading file pom.xml failed.
Finished: FAILURE

Answer Source

As mentioned in "400 BAD request HTTP error code meaning?", an error 400 means the request was malformed.

In your case, a possible cause is the GAV you want to send: the Version is 1.0-SNAPSHOT... sent to a release repo: that kind of version would be rejected by Nexus.
That "Repository policy" should be "snapshots" in order to accept 1.0-SNAPSHOT.