Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Eclipse Plug-in Developer Guide
Previous Page Home Next Page

Composite repositories

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

How it works

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

So in order to create a composite repository, all one needs to do is create a new "index" file for the metadata and/or artifact repository and p2 will recognize that a composite repository has been defined and it will load it and its children. Composite repositories use a different index file name to help p2 recognize them as composite repositories.

Sample composite metadata repository

File: compositeContent.xml

<?xml version='1.0' encoding='UTF-8'?>
<?compositeMetadataRepository version='1.0.0'?>
<repository name='"Eclipse Project Test Site"'
  <properties size='1'>
    <property name='p2.timestamp' value='1243822502499'/>
  <children size='2'>
    <child location=''/>
    <child location=''/>

Sample composite artifact repository

File: compositeArtifacts.xml

<?xml version='1.0' encoding='UTF-8'?>
<?compositeArtifactRepository version='1.0.0'?>
<repository name='"Eclipse Project Test Site"'
  <properties size='1'>
    <property name='p2.timestamp' value='1243822502440'/>
  <children size='2'>
    <child location=''/>
    <child location=''/>

Composite repositories as part of the build

In order to automate composite repository actions in release engineering builds, Ant tasks have been provided which can be called to create and modify composite repositories. The tasks are defined in the bundle.



  • failOnExists - Whether it 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:
    • Compare jars. Class files are disassembled 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.
  • remove - A nested element containing a list repositories to remove from the composite.


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

Note: In the Eclipse Galileo release there is a problem if you use the Ant tasks to add child repositories and you use a relative path for the child location. More information on this problem along with potential workarounds can be found in Bugzilla.

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire