Eclipse p2 Composite Repositories – All the update sites you ever wanted

I frequently install new Integration builds from the Eclipse.org website. Afterwards I used to maintain all my desired update sites, for example EGit and Mylyn and install my favorite packages.

Fortunately I met Pascal Rapicault on EclipseCon and he gave me the tip that I could use Composite Repositories. A composite repository allows me to have one update site which point to other repositories.

For example to create an update site for EGit and Mylyn create the following two files, put them in a local directory and create create a new local update site to be able to install both EGit and Mylyn.

File compositeContent.xml

<?xml version='1.0' encoding='UTF-8'?>
<?compositeMetadataRepository version='1.0.0'?>
<repository name='&quot;Eclipse Project Test Site&quot;'
    type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
  <properties size='1'>
    <property name='p2.timestamp' value='1243822502499'/>
  </properties>
 <children size='1'>
    <child location='http://download.eclipse.org/egit/updates'/>
	<child location='http://download.eclipse.org/tools/mylyn/update/e3.4/'/>
  </children>
</repository>

File compositeArtifacts.xml


<?xml version='1.0' encoding='UTF-8'?>
<?compositeArtifactRepository version='1.0.0'?>
<repository name='&quot;Eclipse Project Test Site&quot;'
    type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
  <properties size='1'>
    <property name='p2.timestamp' value='1243822502440'/>
  </properties>
  <children size='1'>
    <child location='http://download.eclipse.org/egit/updates'/>
	<child location='http://download.eclipse.org/tools/mylyn/update/e3.4/'/>
  </children>
</repository>

Now you can select features from both sites.


A very nice feature of p2. Thanks again to Pascal for the advice.

About Lars Vogel

Lars Vogel is the founder and CEO of the vogella GmbH and works as Eclipse and Android consultant, trainer and book author. He is a regular speaker at international conferences, He is the primary author of vogella.com. With more than one million visitors per month this website is one of the central sources for Java, Eclipse and Android programming information.
This entry was posted in Eclipse and tagged . Bookmark the permalink.

6 Responses to Eclipse p2 Composite Repositories – All the update sites you ever wanted

  1. magomarcelo says:

    isn’t it easier to distribute a bookmark file?

  2. There is an ant task p2.composite.repository that can be used to create these composites.

  3. Lars Vogel says:

    @magomarcelo Not sure what you mean. The files I suggest could also be distributed.

  4. Dennis Doubleday says:

    I think maybe what magomarcelo meant was “how is this superior to just exporting sites to a bookmarks file”? I have the same question.

  5. magomarcelo says:

    yes that’s exactly what I meant, a bookmarks.xml of exported update sites generated from the Preferences

  6. David Green says:

    @Dennis, the idea is that if you’re a solution provider (ie: you’re providing an update site) you can point to 3rd party repositories for your dependencies.

    This is very useful for organizations that have dependencies on components in an Eclipse release (Helios, for example). I expect that a lot of solution providers listing on the Eclipse Marketplace (http://marketplace.eclipse.org) could benefit from using this approach.

Comments are closed.