Error when deploying an artifact in Nexus

前端 未结 13 1286
一向
一向 2020-11-28 21:19

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

相关标签:
13条回答
  • 2020-11-28 21:37

    For 400 error, check the repository "Deployment policy" usually its "Disable redeploy". Most of the time your library version is already there that is why you received a message "Could not PUT put 'https://yoururl/some.jar'. Received status code 400 from server: Repository does not allow updating assets: "your repository name"

    So, you have a few options to resolve this. 1- allow redeploy 2- delete the version from your repository which you are trying to upload 3- change the version number

    0 讨论(0)
  • 2020-11-28 21:43

    400 Bad Request will be returned if you attempt to:

    1. Deploy a snapshot artifact (or version) ending in -SNAPSHOT to a release repository
    2. Deploy a release artifact (version not ending in -SNAPSHOT) to a snapshot repository
    3. Deploy the same version of a release artifact more than once to a release repository
    0 讨论(0)
  • 2020-11-28 21:44

    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.

    0 讨论(0)
  • 2020-11-28 21:44
    • in the parent pom application==> Version put the tag as follows: x.x.x-SNAPSHOT

    example :0.0.1-SNAPSHOT

    • "-SNAPSHOT" : is very important
    0 讨论(0)
  • 2020-11-28 21:44

    This can also happen if you have a naming policy around version, prohibiting the version# you are trying to deploy. In my case I was trying to upload a version (to release repo) 2.0.1 but later found out that our nexus configuration doesn't allow anything other than whole number for releases.

    I tried later with version 2 and deployed it successfully.

    The error message definitely dosen't help:

    Return code is: 400, ReasonPhrase: Repository does not allow updating assets: maven-releases-xxx. -> [Help 1]
    

    A better message could have been version 2.0.1 violates naming policy

    0 讨论(0)
  • 2020-11-28 21:45

    Server id should match with the repository id of maven settings.xml

    0 讨论(0)
提交回复
热议问题