5.2. Browsing Repositories

One of the most straightforward uses of the Nexus is to browse the structure of a Maven repository. If you click on the Browse Repositories menu item in the Views menu, you should see the following display. The top-half of Figure 5.2, “Browsing a Nexus Repository” shows you a list of groups and repositories along with the type of the repository and the repository status. To browse the artifacts that are stored in a local Nexus instance, click on the Browse Storage tab for a repository as shown in Figure 5.2, “Browsing a Nexus Repository”.

Browsing a Nexus Repository

Figure 5.2. Browsing a Nexus Repository


When you are browsing a repository, you can right click on any file and download it directly to your browser. This allows you to retrieve specific artifacts manually, or examine a POM file in the browser.

Note

When browsing a remote repository you might notice that the tree doesn't contain all of the artifacts in a repository. When you browse a proxy repository, Nexus is displaying the artifacts which have been cached locally from the remote repository. If you don't see an artifact you expected to see through Nexus, it only means that Nexus has yet to cache the artifact locally. If you have enabled remote repository index downloads, Nexus will return search results that may include artifacts not yet downloaded from the remote repository. Figure 5.2, “Browsing a Nexus Repository”, is just an example, and you may or may not have the maven-default-skin artifact available in your installation of Nexus.

A Nexus proxy repository acts as a local cache for a remote repository, in addition to downloading and caching artifacts locally, Nexus will also download an index of all the artifacts stored in a particular repository. When searching or browsing for artifacts, it is often more useful to search and browse the repository index. To view the repository index, click on the Browse Index tab for a particular repository to load the interface shown in Figure 5.3, “Browsing a Nexus Repository Index”.

Browsing a Nexus Repository Index

Figure 5.3. Browsing a Nexus Repository Index


As shown in Figure 5.3, “Browsing a Nexus Repository Index”, if an artifact has been downloaded from a remote repository and cached in Nexus, the artifact or folder will display a small Nexus logo.

5.2.1. Viewing Artifact Metadata

Nexus Professional gives you the ability to view artifact metadata. When browsing repository storage or a repository index, clicking on an artifact will load the Artifact Information panel. Selecting the Artifact Metadata tab will display the interface shown in Figure 5.4, “Viewing Artifact Metadata”.

Viewing Artifact Metadata

Figure 5.4. Viewing Artifact Metadata


Artifact metadata consists of a key, a value, and a namespace. Existing metadata from an artifact's POM is given a urn:maven namespace, and custom attributes are stored under the urn:nexus/user namespace.

5.2.2. Editing Artifact Metadata

Nexus Professional gives you the ability to add custom attributes to artifact metadata. To add a custom attribute, click on an artifact in Nexus, and select the Artifact Metadata tab. On the Artifact Metadata tab, click on the Add... button and a new row will be inserted into the list of attributes. Supply a key and value and click the Save button to update an artifact's metadata. Figure 5.5, “Editing Artifact Metadata” shows the Artifact Metadata panel with two custom attributes: "approvedBy" and "approved".

Editing Artifact Metadata

Figure 5.5. Editing Artifact Metadata