Archiva allows you to define remote repositories and repository connectors to proxy remote repositories and cache remote artifacts from remote repositories in Archiva Managed Repositories. While Nexus also provides Proxy repositories, there is one major difference between Nexus and Archiva. Where Nexus maintains a separate local storage directory for each proxy repository, Archiva combines cached remote artifacts into a single filesystem with the contents of a managed repository. In other words, there is no good way to transfer an existing local cache of artifacts between Archiva and Nexus without manually manipulating the contents of Archiva’s Managed Repository directory.
To recreate an Archiva repository connector in Nexus as a Proxy repository and to preserve the local cache of artifacts from this repository. You’ll need to create a Proxy repository in Nexus, copy the contents of the existing proxy repository to the Nexus storage location for you new Proxy repository, and then rebuild the metadata of your new Nexus Proxy repository.
First step is to take a look at the Remote Repositories in your Archiva installation: log in as an administrative user and then click on "Repositories" under the Administration menu in the left-hand Archiva navigation menu. Once you’ve clicked this link and loaded the list of repositories, scroll to the bottom of the page to see the list of remote repositories as shown in Figure B.5, “Browsing Archiva Remote Repositories”.
Defining a proxy repository in Archiva involves associating one of the remote repositories defined in Figure B.5, “Browsing Archiva Remote Repositories” with one of the Managed Repositories defined in Figure B.1, “Archiva Managed Repositories”. Once you do this, requests for artifacts from the managed repository will also query the remote repository. If an artifact is found in the remote repository, it will be retrieved and stored in the managed repository’s storage directory. To see a list of proxy connectors and the managed repositories they are associated with, click on "Proxy Connectors" in the left-hand Archiva menu, you will see a list similar to that shown in Figure B.6, “Archiva Proxy Connectors”.
Click on the Edit Icon (or Pencil) next to second Proxy Connector listed in Figure B.6, “Archiva Proxy Connectors”, this will then load the settings form for this proxy connector shown in Figure B.7, “Archiva Proxy Connector Settings”. You should use the settings for this proxy connect to configure your new Nexus Proxy repository.
To create a Proxy repository that will correspond to the Proxy Connector in Archiva, log into Nexus as an administrative user, and click on Repositories in the left-hand Nexus menu. Once you can see a list of Nexus repositories, click on Add… and select Proxy Repository from the drop-down of repository types. In the New Proxy Repository form (shown in Figure B.8, “Creating a Nexus Proxy Repository”) populate the repository ID, repository Name, and use the remote URL that was displayed in Figure B.5, “Browsing Archiva Remote Repositories”. You will need to create a remote repository for every proxy connector that was defined in Archiva.
To expose this new Proxy repository in a Repository Group, create a new Nexus Repository group or select an existing group by clicking on Repositories in the left-hand Nexus menu. Click on a repository group and then select the Configuration tab to display the form shown in Figure B.9, “Adding a Proxy Repository to a Repository Group”. In the Configuration tab you will see a list of Order Group Repositories and Available Repositories. Click and drag your new Nexus Proxy repository to the list of Ordered Group Repositories, and click Save.
Next, you will need to define repository groups that will tell Nexus to only locate certain artifacts in the newly created proxy repository. In , Archiva defined three patterns that were used to filter artifacts available from the proxy connector. These three patterns were "javax/", "com/sun/", and "org/jvnet/**". To recreate this behaviour in Nexus, define three Routes which will be applied to the group you configured in Figure B.9, “Adding a Proxy Repository to a Repository Group”. To create a route, log in as an administrative user, and click on Routes under the Administration menu in the left-hand Nexus menu. Click on Add.. and add three inclusive routes that will apply to the repository group you configured in Figure B.9, “Adding a Proxy Repository to a Repository Group”.