Much ado about scripting, Linux & Eclipse: card subject to change


Troubleshooting Mirrors / Using Profiles & Target Platform Definition Files With Tycho

If you look in the mirror and you say his name 5 times, he'll appear behind you breathing down your neck. - Candyman

If only troubleshooting mirrors was so simple. Have you ever been running a build or an install which stalls at the provisioning step, with a message like:

[INFO] Fetching org.eclipse.birt.integration.wtp.ui_2.6.0.v20100617-1315.jar.pack.gz (4.3MB of 46.13MB at 171.56kB/s) from

The solution here is often simply to force p2 to pick a specific mirror rather than letting it choose any mirror it wants.

How, you ask?

Well, assuming you were polling this site looking for artifacts to install or update...

... you would then change that URL to this, and look at the list of available mirrors:

Now it's a trivial matter to select a mirror that's close to you and try that instead of the mirror, such as:

If you're running a Tycho build, this URL should be changed in your parent-pom.xml ...


... or your .target platform file, depending on which way you're building.

<repository location=""/>

If you rely on a parent-pom.xml, make sure you're activating the profile with the revised URL...

mvn3 clean install -U -B -fae -Phelios

... or, if you're building against a .target platform file, make sure you update the URL in that file, and that your build points to the profile which will load the .target file.

mvn3 clean install -U -B -fae -P!helios,helios-no-target

UPDATE, 2010/08/11: Forgot to mention that there are a number of p2 update site zips available here to help with your offsite mirroring:


Max said... how does one convince the P2 update UI for the same ? said...

Hi Nick,

since the mirror has the same metadata (artifacts.xml/content.xml) as, it still points back to as the primary site (p2.mirrorsURL). Only removing this property will force p2 to not use mirrors at all. But then, who can change the metadata of a mirror? An alternative might be to instruct p2 to exclusively use (eclipse.p2.mirrors=false).
Aside from that, you can ask the webmasters to tweak download.php to return your preferred mirror first based on the IP the request comes from. Though p2 still chooses mirrors based on a logarithmic distribution with the first mirror be used with a chance of 1/2, second 1/4... (org.eclipse.equinox.internal.p2.artifact.repository.MirrorSelector.selectMirror(IProgressMonitor))

David Carver said...

I've found also that Tycho 0.9.0 seems to handle mirror issues easier, and has better handling of picky update sites as well.

nickb said...

I've recently given up and just started creating my own mirrors. Thanks to the magic of Tycho, I only need:

a) rsync the stuff from to somewhere else
b) add pom.xml files to the plugins
c) create site.xml + pom.xml
d) build update site
e) publish to my own mirror w/ fresh metadata

There's prolly an easier way, but this worked for me.