Skip to end of metadata
Go to start of metadata
Table of Contents

Overview

Artifactory supports advanced proxying and caching of P2 repositories and P2 metadata aggregation (since Artifactory 2.4).

An Artifactory virtual repository can serve as a single point of distribution (single URL) for Eclipse, Tycho and any other P2 clients.

This virtual repository aggregates P2 metadata and P2 artifacts from underlying standard local and remote repositories in Artifactory. This provides you with full visibility of the P2 artifact sources and allows powerful management of caching and security aspects for P2 content.

For P2 support it is recommended to use Eclipse Helios (3.6) and above.

Older Eclipse versions may not work correctly against Artifactory P2 repositories. 

Configuring Artifactory

Virtual Repository Configuration

To enable P2 metadata aggregation on a virtual repository, create a Virtual Repository from Artifactory's user interface and select the 'P2' tab.


 

On this tab, you must enable P2 support and then add either a local repository that hosts your P2 metadata and content or remote P2 repository URLs you want to aggregate.

P2 Local Repository

Local repositories do not have any P2 dedicated configuration, choose the desired local repository from the repositories combo box and add a sub path pointing to the P2 metadata files (content.jar, artifacts.jar, compositeContent.xml, etc.). When the sub path field is left empty, P2 metadata files are assumed to reside directly under the repository's root.

If you have a Tycho repository deployed to a local repository as a single archive, specify the archive's root path. For example: 'eclipse-repository.zip!/'. 

For each local repository added, you can (and should) include the repository in the list of (local and remote) repositories aggregated by this virtual repository.

The following options are proposed for a remote repository in the repositories list table:

  1. Include: Adds the local repository to the list of repositories aggregated by this virtual repository.
  2. Included: Shows the repository is already included in the virtual repository. 

P2 Remote Repository

Select a P2 repository URL to add to Artifactory. The URL entered here should point at the path where P2 metadata files are found (content.jar, artifacts.jar, compositeContent.xml, etc.).

For example:

  1. The main Juno repository: http://download.eclipse.org/releases/juno
  2. The Google plugins repository for Indigo (GWT, GAE, etc.): http://dl.google.com/eclipse/plugin/3.7

When P2 metadata files reside inside an archived file, simply add '!' to the end of the URL, for example: http://eclipse.org/equinox-sdk.zip!/

Artifactory analyzes the added URL and based on the remote P2 metadata, identifies which remote repositories are required to be created in Artifactory (remote P2 repositories may aggregate information from different hosts).

For each identified remote repository you can (and should) create and include the repository in the list of (local and remote) repositories aggregated by this virtual repository.
The following options are proposed for a remote repository in the repositories list table:

  1. Create: Create a new, P2 enabled, remote repository with the given key (the remote repo key is editable).
  2. Modify: Enable P2 support in an existing remote repository.
  3. Include: Add the remote repository to the list of repositories aggregated by this virtual repository.
  4. Included: Shows the repository is already included in the virtual repository. 

 

When created from the virtual repository, remote repositories have P2 support enabled automatically.

This flag is required so that the remote repository can manage the proxy-cache of an external P2 repository, including the expiration of cached P2 resources (content.jar, artifacts.jar, compositeContent.xml, etc.).

This flag can also be manually controlled by browsing to a remote repository's configuration panel and selecting the 'Packages' tab.

Integration with Tycho Plugins

Artifactory fully supports hosting of Tycho plugins as well as resolving Tycho build dependencies.

In order to resolve all build dependencies through Artifactory, simply change the repository URL tag of your build POM.xml file and point it to a dedicated virtual repository inside Artifactory

For example:

<repository>
    <id>eclipse-indigo</id>
    <layout>p2</layout>
    <url>http://localhost/artifactory/p2</url>
</repository>

The P2 virtual repository should contain URLs to all local repositories with an optional sub path in them where Tycho build artifacts reside. 

P2 Client Configuration

Using Artifactory P2 Virtual Repository in Eclipse

Once the virtual repository is correctly configured, you must modify your Eclipse configuration to point at the new P2 Artifactory URL.

For example, if the new virtual repository key is 'p2', you can add the following URL http://yourserver/artifactory/p2 to the list of 'Available Software Sites':


  • No labels