Maven – Nexus access rights for particular repository

mavennexus

In Sonatype Nexus, I would like to create a user who'd have different access rights to particular repositories, like so:

  • Repository "Releases": create, view, read (so a released version can never be updated or deleted)
  • Repository "Snapshots": create, update, view, read

I tried searching in the section "Repository targets", but all I can do there is giving access to filtered artifacts across all repositories. Predefined groups of repositories are also only based on repo type (M1/M2/Site).

How can I differentiate access based on repository only, regardless of artifacts?

Best Answer

You need to login as admin and navigate to "Security". In there you will see "Privileges" and "Roles". You need to define privileges for the respective repository. By default each repository comes with a privilege called "View". You need to manually create a new privilege Create, Read, Update, Delete (which are created all together as a bunch). Once you have this set up, you need to create a Role and associate those privileges with this role. After that you have to edit the user and assign them the newly created role(s).

If you'd like to go even further and limit developers' access to repositories based on groupId-s, you can check this excellent article for tips.

Related Topic