Repository Management with Nexus
Repository Management with Nexus

A.10. Configuring Artifactory Clients to Use Nexus

Nexus is a drop-in replacement for Artifactory, this means that you don’t need to reconfigure your project’s settings.xml and repository elements throughout your POMs to start using Nexus. When you installed the Nexus Migration plugin, you also installed a web application called the Artifactory Bridge which should be running under the context path /artifactory next to the /nexus application. If you run Nexus at the default http://localhost:8081/nexus/ URL, the artifactory bridge will be running at http://localhost:8081/artifactory/

This Artifactory Bridge will serve repository metadata and artifacts from Nexus under the same URLs that your existing Artifactory clients expect. When you were configuring your repositories during the Artifactory Import in Section A.7, “Configuring Artifactory Repository Imports”, you’ll remember that there was a column named Map URL check box for a repository instructed the Nexus Migration plugin to configure a mapping between the old Artifactory URL and repository identifier and the new Nexus URL and repository identifier.

To see this mapping in action, take a look at the Central repository through three different URLs. This example assumes that you mapped your old repo1 Artifactory proxy repository to the Nexus central proxy repository. Let’s take a quick look at the URL for metadata.xml for the nexus-index artifact which is under the group identifier org.sonatype.nexus. To retrieve this directly from the Maven Central repository, you would use the following URL:

http://repo1.maven.org/maven2/\
org/sonatype/nexus/nexus-indexer/maven-metadata.xml

To retrieve the same file from the Nexus central proxy of the Maven Central repository, you would use the following URL which contains the new Nexus repository identifier "central":

http://localhost:8081/nexus/content/repositories/central/\
org/sonatype/nexus/nexus-indexer/maven-metadata.xml

To retrieve the same file from the Artifactory Bridge, you would use the following URL which contains the old Artifactory repository identifier "repo1":

http://localhost:8081/artifactory/repo1/\
org/sonatype/nexus/nexus-indexer/maven-metadata.xml

The configuration for these mappings is stored in sonatype-work/nexus/conf/mapping.xml. This is an XML file which was configured during the import that maps the old Artifactory repository identifiers to the new Nexus repository identifiers. The Artifactory Bridge web application is configured in $NEXUS_HOME/conf/plexus.xml contains a reference to the web application and also configures the context-path /artifactory

Sonatype Promotion Subscribe via RSS