Jump to: navigation, search

Difference between revisions of "Equinox p2 Repository Mirroring"

(Fixed broken CVS link)
(Running the Mirroring Tools)
Line 22: Line 22:
 
==Running the Mirroring Tools==
 
==Running the Mirroring Tools==
  
Run from the command line by running the Agent with the args below (e.g. eclipse.exe -application org.eclipse.equinox.p2.tools.MirrorApplication -source ...).  
+
Currently, the mirror application is split into two different applications: one for artifacts and one for metadata.
  
For example, to make an exact mirror of a metadata and artifact repositories, use the following arguements.  Note that if the target repository does not exist, a new repository is created.
+
===Mirroring Metadata===
  
   -application org.eclipse.equinox.p2.tools.MirrorApplication
+
To make an exact mirror of a metadata repository, use the following arguments.  Note that if the target repository does not exist, a new repository is created with the same properties as the source.
 +
 
 +
   -application org.eclipse.equinox.p2.metadata.repository.MirrorApplication
 
   -source Insert Source URL (e.g. <nowiki>http://download.eclipse.org/eclipse/updates/3.4milestones/</nowiki>)
 
   -source Insert Source URL (e.g. <nowiki>http://download.eclipse.org/eclipse/updates/3.4milestones/</nowiki>)
 
   -destination Insert Destination URL (e.g. file:/tmp/3.4milestonesMirror/)
 
   -destination Insert Destination URL (e.g. file:/tmp/3.4milestonesMirror/)
   -ius all
+
   -append
  -artifacts all
+
  
  
If you want to mirror only the metadata then remove the line: '''-artifacts all'''  
+
If you omit the '''-append''' argument, all installable units in the target destination will be removed before the mirroring is performed.
  
If only the artifacts are desired then remove the line: '''-ius all'''
+
===Mirroring Artifacts===
  
For a compressed destination repository, add the line: '''-compressed'''
+
To make an exact mirror of an artifact repository, use the following arguments.  Note that if the target repository does not exist, a new repository is created with the same properties as the source.
  
and the resulting destination artifact or content xml will be in compressed jar format.
+
   -application org.eclipse.equinox.p2.artifact.repository.MirrorApplication
 
+
  -source Insert Source URL (e.g. <nowiki>http://download.eclipse.org/eclipse/updates/3.4milestones/</nowiki>)
To enable the verbose feature, add the line: '''-verbose'''
+
  -destination Insert Destination URL (e.g. file:/tmp/3.4milestonesMirror/)
 
+
  -append
The mirror app is set to append artifacts by default.
+
 
+
To delete the destination repository before writing, add the line: '''-overwrite'''
+
 
+
===Selective Mirroring===
+
 
+
If only a piece of the source repository should be mirrored, then you can specify the individual components as arguments. For ius the format is
+
 
+
  -ius IU,IU2/Version,IU3/[VersionRange]
+
 
+
For example,
+
   -ius org.eclipse.sdk.examples.source,org.eclipse.ui.examples.undo.source/3.2.100,org.eclipse.jdt.ui.examples.projects.source /[3.1.0,3.2.0]
+
 
+
If all associated artifacts should be mirrored with the metadata, add the line '''-artifacts all''' and each mirrored metadata will also mirror the artifact with it.
+
  
For mirroring simple artifact repository selections, the format is
 
  
  -artifacts {classifier,iu,version},{classifier,iu,version}
+
If you omit the '''-append''' argument, all artifacts in the target destination will be removed before the mirroring is performed.
  
For example,
+
Adding the argument '''-verbose''' will enable verbose error reporting and logging.
  
  -artifacts {osgi.bundle,org.eclipse.swt.examples.browser,3.1.100.v3320c},{osgi.bundle,org.eclipse.sdk.examples.source,3.1.100.v20070605}
+
Adding the argument '''-ignoreErrors''' will ensure the mirror application does not fail in the event of an error. Note: while using this argument the mirror application may complete without errors but the destination repository may not include all artifacts from the source repository.

Revision as of 15:27, 18 November 2008

Introduction

p2 manages all of its data in repositories. There are two types of repos, artifact and metadata.

p2 artifact repositories can hold many different forms of the same artifact. For example, a JAR artifact may exist as

  • a canonical (unmolested) JAR
  • a compressed JAR (assuming the original was not compressed)
  • a pack200 JAR
  • a delta relative to another version of the artifact
  • ...

p2 metadata repositories describe inter-component dependencies and identify artifacts to install.

The Repository Mirroring application can be used to mirror artifact and metadata repositories. In addition, users can do selective mirroring of artifacts or metadata either to create a more specific mirror (e.g. only mirror latest code) or merge content into an existing mirror.

This example demonstrates how to mirror a repository using the repository mirror application available in the equinox p2 tools.

Getting the Mirroring Tools

The mirroring application is in the org.eclipse.equinox.p2.tools bundle, available in CVS at http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tools/. The plan is to add this application to the Equinox p2 agent download available on the Equinox download page. See bug 237100 for progress on adding the mirror application to the p2 agent download.

Running the Mirroring Tools

Currently, the mirror application is split into two different applications: one for artifacts and one for metadata.

Mirroring Metadata

To make an exact mirror of a metadata repository, use the following arguments. Note that if the target repository does not exist, a new repository is created with the same properties as the source.

 -application org.eclipse.equinox.p2.metadata.repository.MirrorApplication
 -source Insert Source URL (e.g. http://download.eclipse.org/eclipse/updates/3.4milestones/)
 -destination Insert Destination URL (e.g. file:/tmp/3.4milestonesMirror/)
 -append


If you omit the -append argument, all installable units in the target destination will be removed before the mirroring is performed.

Mirroring Artifacts

To make an exact mirror of an artifact repository, use the following arguments. Note that if the target repository does not exist, a new repository is created with the same properties as the source.

 -application org.eclipse.equinox.p2.artifact.repository.MirrorApplication
 -source Insert Source URL (e.g. http://download.eclipse.org/eclipse/updates/3.4milestones/)
 -destination Insert Destination URL (e.g. file:/tmp/3.4milestonesMirror/)
 -append


If you omit the -append argument, all artifacts in the target destination will be removed before the mirroring is performed.

Adding the argument -verbose will enable verbose error reporting and logging.

Adding the argument -ignoreErrors will ensure the mirror application does not fail in the event of an error. Note: while using this argument the mirror application may complete without errors but the destination repository may not include all artifacts from the source repository.