Contents

Enabling your repository to leverage mirrors

The p2.mirrorsURL should be added to your metadata so that p2 will see the list
of available mirrors to choose during installation.

Where to add?

Adding this property to artifacts.xml is sufficient, since p2 uses a list of mirrors while retrieving artifacts, not the metadata itself. Obviously, artifacts.jar
must be updated or replaced after changing artifact.xml.

Should composite repos be treated, too, or just their children (leaves)?

Just the leaves. No need to to specify the property in compositeArtifacts.xml/jar.

the last part, &amp;protocol=http is important, since it restricts the list of mirrors to those that support http, which is what p2 uses. (In general, for zip files linked on download pages, and similar, the 'protocol' parameter is is optional, in which case both http and ftp oriented mirrors are returned).

This will tell p2 to use the given URL for fetching a list of available mirrors (in xml format).

How to add?

If you use a site.xml the word goes that this is where you should specify this property. The Equinox/p2/Publishershould automatically
transfer this information into your metadata.

If you don't use a site.xml you may consider manually editing artifacts.xml (which of course can be automated using, e.g.,
an xsl template, like this p2.xsl from the Mylyn project). When manually editing artifacts.xml add the property to the existing list of properties right at the top of the document. Don't forget to update the size attribute of the enclosing <properties> element.

How to test?

First, you may paste the full URL you specified as the value into your browser (now collapse &amp; to &). The result should be an XML file with lots of mirror URLs. Pasting one of these URLs into the browser should in turn take you to the directory holding your artifacts.jar and friends.

Secondly, to test whether install successfully uses mirrors you may use the following options file (stored, e.g., as /tmp/p2options):

This should install your feature and print to the console where each artifact was downloaded from.
If p2.mirrorsURL is not properly configured no such messages will be shown.

Conversely, you can disable the automatic mirror selection mechanism by setting the VM argument eclipse.p2.mirrors to false (remember that vm args have to be last on the command line preceded by the switch -vmargs).