How to Configure P2 to Cache Artifacts in a Remote Repository

JFrog Support
2023-01-22 11:08

To configure P2 to cache artifacts in Artifactory, you'll need to add aremote repositorythat will point to the URL where the artifacts with which you'd like to work are stored. You can create your remote repository via the Artifactory UI by:

  1. Navigating toAdmin tab > Configuration > Repositories

  2. UnderRemote repository, clickNew, and enter yourrepository key(i.e., the name of your repository in Artifactory), and the URL from which you'd like to resolve your artifacts (e.g., Eclipse’s Helios, Juno, or Tycho).

Another option is to create avirtual repositorythat will aggregate both your remote and local repositories. You can do this by:

  1. Navigating toAdmin tab > Configuration > Repositories

  2. SelectVirtual Repositoriesand create anew repository

  3. UnderRemote P2 Repositories, enter the remote URL. Thereafter, Artifactory will recognize and display what action will be taken once you select theSave & Finish button.

After executing either scenario above, each time you resolve an artifact, Artifactory will first check theP2 cacheand, if the artifact is present, Artifactory will provide it from the cache. Otherwise, Artifactory will download it from theURLyou have provided and cache it for future use.

For further information please visit our wiki page aboutP2 Repositories.