In the left-hand navigation area, there is an Artifact Search text field next to a magnifying glass. To search for an artifact by groupId or artifactId, type in some text and click the magnifying glass. Typing in the search term "guice" and clicking the magnifying glass should yield a search result similar to Figure 5.9, “Results of an Artifact Search for "guice"”.
Once you’ve located the artifact you were looking for you can click on the pom link to download the POM or the artifact link to download the artifact.
- Look at the Version column in the search results. In this version of the search interface, we decided to list the most recent version. If you need to view a different version, click on "Show All Versions". Clicking on "Show All Versions" will drill down into the list of available versions.
- Look at the Download column in the search results. This Download column contains direct download links for the most recent version of the artifact. To download a matching artifact, just click on a link in this column.
- Select a search result, and you will see the artifact in the Repository Tree in the lower left-hand quadrant of this interface. This is helpful to give you context for an artifact. An artifact could be present in more than one repository. If this is the case, click on the value next to "Viewing Repository" to switch between multiple matching repositories.
-
In the lower right-hand quadrant of the interface, you will see a number of tabs which show information about the selected search result:
- Maven Information: This contains basic identifiers and a snippet of XML you can use to add this artifact as a project dependency.
- Archive Browser (Nexus Professional): This gives you a way to explore the contents of an archive in the repository. You can view the files and folders contained in a matching search result.
- Artifact Information: This tab contains timestamps, file size, checksum values, and a list of repositories containing a given artifact.
- Artifact Metadata (Nexus Professional): This tab shows all of the built-in and custom metadata associated with an artifact.
In addition to searching by a groupId or an artifactId, Nexus has a feature which allows you to search for an artifact by a checksum.
Warning
Let me guess? You installed Nexus, ran to the search box, typed in the name of a group or an artifact, pressed search, and saw absolutely nothing. No results. Nexus isn’t going to retrieve the remote repository indexes by default, you need to activate downloading of remote indexes for the three proxy repositories that Nexus ships with. Without these indexes, Nexus has nothing to search. Find instructions for activating index downloads in Section 6.5, “Managing Repositories”.
OpenSearch a standard which facilitates searching directly from your browser’s search box. If you are using Internet Explorer 7+ or Firefox 2+ you can add any Nexus instance as an OpenSearch provider. Then you can just type in a search term into your browser’s search field and quickly search for Maven artifacts. To configure OpenSearch, load Nexus in a browser and then click on the dropdown next to the search tool that is embedded in your browser. Figure 5.10, “Configuring Nexus as an OpenSearch Provider” shows the Add Nexus option that is present in Firefox’s OpenSearch provider dropdown.
Once you have added Nexus to the list of OpenSearch providers, click on the dropdown next to the search term and select Nexus (localhost) from the list of OpenSearch providers. Type in a groupId, artifactId, or portion of a Maven identifier and press enter. Your opensearch-friendly web browser will then take you to the search results page of Nexus displaying all the artifacts that match your search term.
Once, you have configured your browser to use Nexus as an OpenSearch provider, searching for a Maven artifact is as simple as typing in a groupId or artifactId, selecting Nexus from the dropdown shown in Figure 5.12, “Nexus Available as an Option in the Firefox OpenSearch Provider List”, and performing a search.
Nexus Professional provides you with the ability to configure custom artifact metadata and search for artifacts with specific metadata. To search for artifacts using metadata, click on the Advanced Search link directly below the search field in the Nexus application menu to open the Search panel. Once in the search panel, click on the Keyword Search and click on Metadata Search in the search type dropdown as shown in Figure 5.13, “Searching Artifact Metadata”.
Once you select the Metadata Search you will see two search fields and an operator dropdown. The two search fields are the key and value of the metadata you are searching for. The key corresponds to the key of the metadata you are searching for, and the value contains the value or value range you are searching for. The operator dropdown can be set to Equals, Matches, Bounded, or Not Equal.
Once you locate a matching artifact in the Metadata Search interface, click on the artifact and then select the Artifact Metadata to examine an artifacts metadata as shown in Figure 5.15, “Metadata Search Results for Custom Metadata”.