Error when deploying an artifact in Nexus

前端 未结 13 1287
一向
一向 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:46

    Ensure that not exists already (artifact and version) in nexus (as release). In that case return Bad Request.

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

    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.

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

    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.

    0 讨论(0)
  • 2020-11-28 22:01

    A couple things I can think of:

    • user credentials are wrong
    • url to server is wrong
    • user does not have access to the deployment repository
    • user does not have access to the specific repository target
    • artifact is already deployed with that version if it is a release (not -SNAPSHOT version)
    • the repository is not suitable for deployment of the respective artifact (e.g. release repo for snapshot version, proxy repo or group instead of a hosted repository)

    Check those and if you still run into trouble provide more details here.

    0 讨论(0)
  • 2020-11-28 22:01

    If any of the above answers worked out, You can create new artifact directly from the admin side of (NEXUS Screen shot attached below).

    1. Login to nexus UI http://YOUR_URL:8081/nexus( username: admin default password: admin123 )
    2. Click repositories on the left side then click the repo, For eg: click release.
    3. Choose artifact Upload (last tab).
    4. Choose GAV definition as GAV Param- Then enter your groupid , artifact id and version .
    5. Choose Jar file.
    6. Click upload artifact. Thats it !

    Now you will be able to add the corrsponding in your project.(screenshot below)

    0 讨论(0)
  • 2020-11-28 22:02

    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

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