Equinox/p2/Composite Repositories (new)

As repositories continually grow in size they become harder to manage. The goal of composite repositories is to make this task easier by allowing you to have a parent repository which refers to multiple children. Users are then able to reference the parent repository and the children's content will transparently be available to them.

Contents

How It Works

With the built-in repository types defined by p2, when a user connects to a server we check to see if there are any files that we recognize. In particular for metadata repositories we look for a content.xml file or a content.jar and in the case of artifact repositories we look for an artifacts.xml or artifacts.jar file.

So in order to create a composite repository, all you need to do is create a new file (compositeContent.xml/compositeContent.jar or compositeArtifacts.xml/compositeArtifacts.jar) and p2 will recognize that you have defined a composite repository and load it from there.

Composite Repositories as part of the build

In order to automate composite repository actions in release engineering builds, we have created Ant tasks which can be called to create and modify repositories. The tasks are defined in the org.eclipse.equinox.p2.repository.tools bundle.

p2.composite.repository

Attributes

failOnExists - Whether we should fail if the repository already exists. (Default is false)

validate - A comparator-id. Child repositories claiming to contain the same artifact are compared using the given comparator. These are extensions to the org.eclipse.equinox.p2.artifact.repository.artifactComparators extension point. Comparators provided by p2 are:

org.eclipse.equinox.p2.repository.tools.jar.comparator: Compare jars. Class files are dissassembled and compared for equivalence, properties and manifest files are compared as such, all other files are compared byte-for-byte.

org.eclipse.equinox.artifact.md5.comparator: Compare the MD5 sums as recorded in the artifact repositories.

Sub-elements

add - A nested element containing a list of repositories to add to the composite.

remove - A nested element containing a list repositories to remove from the composite.

Examples

Some example Ant tasks for composite repositories and further explanation can be found on the p2 Ant tasks page.