Repository Management with Nexus

4.5. Adding a Repository to a Group

Next you will need to add the new repository to the Public Repositories Nexus repository group. To do this, click on the Repositories link in the left-hand Nexus menu in the Views/Repositories section. Nexus lists Groups and Repositories in the same list so click on the public group. After clicking on the Public Repositories group, you should see the Browse and Configuration tabs in the lower half of the Nexus window.

Note

If you click on a repository or a group in the Repositories list and you do not see the Configuration tab, this is because your Nexus user does not have administrative privileges. To perform the configuration tasks outlined in this chapter, you will need to be logged in as a user with administrative privileges. f Clicking on the Configuration tab will bring up a screen which looks like Figure 4.3, “Adding New Repositories to a Nexus Group”.

figs/web/repository-manager_add-to-group.png

Figure 4.3. Adding New Repositories to a Nexus Group


To add the new repository to the public group, find the repository in the Available Repositories list on the right, click on the repository you want to add and drag it to the left to the Ordered Group Repositories list. Once the repository is in the Ordered Group Repositories list you can click and drag the repository within that list to alter the order in which a repository will be searched for a matching artifact.

Note

Nexus makes use of the Javascript widget library ExtJS. ExtJS provides for a number of UI widgets that allow for rich interaction like the drag-drop UI for adding repositories to a group and reordering the contents of a group.

In the last few sections, you learned how to add a new custom repositories to a build in order to download artifacts which are not available in the Central Repository.

If you were not using a repository manager, you would have added these repositories to the repository element of your project’s POM, or you would have asked all of your developers to modify ~/.m2/settings.xml to reference two new repositories. Instead, you used the Nexus repository manager to add the two repositories to the public group. If all of the developers are configured to point to the public group in Nexus, you can freely swap in new repositories without asking your developers to change local configuration, and you’ve gained a certain amount of control over which repositories are made available to your development team.