Skip to main content

Adding a Repository to a Group in Nexus Repository 2

Nexus Repository 2

After Adding a New Repository, you will need to add the new repositories to the Public Repositories repository group. To do this, click on the Repositories link in the left-hand main menu in the Views/Repositories section. The repository manager lists Groups and Repositories in the same list. Clicking on the Public Repositories group, you should see a Configuration tab in the lower half of the user interface.

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 user account does not have administrative privileges. To perform the configuration tasks outlined in this section, you will need to be logged in as a user with administrative privileges.

Clicking on the Configuration tab will bring up a screen which looks like Figure 4.3, “Adding New Repositories to a Repository Group”.

5410353.png

Figure 4.3. Adding New Repositories to a Repository 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 component.

Note

The repository manager user interface 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 components that 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 repository manager to add the two repositories to the public group. If all of the developers are configured to point to the public repository group, 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. In addition the performance of the component resolving across multiple repositories will be handled by repository manager and therefore be much faster than client side resolution done by Maven each time.