Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Equinox/p2/Composite Repositories (new)"

< Equinox‎ | p2
Line 1: Line 1:
 
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.  
 
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 <code>http://example.eclipse.org/updates</code> then the children are <code>http://example.eclipse.org/updates/childOne</code> and <code>http://example.eclipse.org/updates/childTwo</code>.
+
===Sample Composite Metadata Repository===
  
===Sample content.xml file===
+
In the sample files below there is a parent repository with two children. Note that the physical location of the children (in this example) are relative paths which are sub-folders of the parent. For instance, if the location of the parent is <code>http://example.eclipse.org/updates</code> then the children are <code>http://example.eclipse.org/updates/childOne</code> and <code>http://example.eclipse.org/updates/childTwo</code>. You are also able to use absolute URIs as the children repository locations.
 +
 
 +
''compositeContent.xml''
  
 
<pre>
 
<pre>
 
<?xml version='1.0' encoding='UTF-8'?>
 
<?xml version='1.0' encoding='UTF-8'?>
 
<?compositeMetadataRepository version='1.0.0'?>
 
<?compositeMetadataRepository version='1.0.0'?>
<repository name='&quot;Eclipse Project Test Site&quot;'
+
<repository name='&amp;quot;Eclipse Project Test Site&amp;quot;'
 
     type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
 
     type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
 
   <properties size='2'>
 
   <properties size='2'>
Line 21: Line 23:
 
</pre>
 
</pre>
  
===Sample artifacts.xml file===
+
===Sample Composite Artifact Repository===
 +
 
 +
''compositeArtifacts.xml''
  
 
<pre>
 
<pre>
 
<?xml version='1.0' encoding='UTF-8'?>
 
<?xml version='1.0' encoding='UTF-8'?>
 
<?compositeArtifactRepository version='1.0.0'?>
 
<?compositeArtifactRepository version='1.0.0'?>
<repository name='&quot;Eclipse Project Test Site&quot;'
+
<repository name='&amp;quot;Eclipse Project Test Site&amp;quot;'
 
     type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
 
     type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
 
   <properties size='2'>
 
   <properties size='2'>

Revision as of 10:39, 2 June 2009

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.

Sample Composite Metadata Repository

In the sample files below there is a parent repository with two children. Note that the physical location of the children (in this example) are relative paths which are sub-folders of the parent. For instance, if the location of the parent is http://example.eclipse.org/updates then the children are http://example.eclipse.org/updates/childOne and http://example.eclipse.org/updates/childTwo. You are also able to use absolute URIs as the children repository locations.

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='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 Composite Artifact Repository

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='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 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. See source repositories above.
  • remove - A nested element containing a list repositories to remove from the composite. See source repositories above.

Examples

Some example Ant tasks for composite repositories are found here.

Back to the top