Search code examples
mavennexusmaven-metadata

Using nexus deployment role - Error installing artifact's metadata - Authorization failed


When executing mvn deploy with a user with the Nexus Deployment Role granted I am getting the following error message.

Error installing artifact's metadata: Error while deploying metadata: Authorization failed: Access denied to: http://maven.mydomain.com/content/repositories/releases/testing/testapp/maven-metadata.xml

This must have something to do with missing some missing permission to update the maven-metadata.xml file because when I deploy the first version of the artifact on the repository with the same user it completes successfully (there is no maven-metadata.xml to update and it gets created successfully). Also when I run mvn deploy with the admin account I do not have this issue.

What additional privileges apart from the Nexus Deployment Role do I need to assign to my user to be able to update maven-metadata.xml?

Thanks


Solution

  • You also need to grant the user privileges to write artifacts into the target repository. You can do this by giving them the "repo: all repositories (full control)" role, or you can create a custom role with more specific privileges:

    http://books.sonatype.com/nexus-book/reference/security.html