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.
In the sample files below there is a parent repository with two children. Note that the location of the children (in this example) are children of the parent. For instance, if the location of the parent is
http://example.eclipse.org/updates then the children are
Sample content.xml file
<?xml version='1.0' encoding='UTF-8'?> <?compositeMetadataRepository version='1.0.0'?> <repository name='"Eclipse Project Test Site"' type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'> <properties size='2'> <property name='p2.compressed' value='true'/> <property name='p2.timestamp' value='1243822502499'/> </properties> <children size='2'> <child location='childOne'/> <child location='childTwo'/> </children> </repository>
Sample artifacts.xml file
<?xml version='1.0' encoding='UTF-8'?> <?compositeArtifactRepository version='1.0.0'?> <repository name='"Eclipse Project Test Site"' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'> <properties size='2'> <property name='p2.compressed' value='true'/> <property name='p2.timestamp' value='1243822502440'/> </properties> <children size='2'> <child location='childOne'/> <child location='childTwo'/> </children> </repository>
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
- 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.
- add - A nested element containing a list of repositories to add to the composite. See source repositories above.
- remove - A nested element containing a list repositories to remove from the composite. See source repositories above.
Some example Ant tasks for composite repositories are found here.