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 http://mirrors.xmission.com/eclipse/birt/update-site/2.6/plugins/org.eclipse.birt.integration.wtp.ui_2.6.0.v20100617-1315.jar.pack.gz
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...
http://download.eclipse.org/birt/update-site/2.6/
... you would then change that URL to this, and look at the list of available mirrors:
http://www.eclipse.org/downloads/download.php?file=/birt/update-site/2.6/
Now it's a trivial matter to select a mirror that's close to you and try that instead of the download.eclipse.org mirror, such as:
ftp://mirror.csclub.uwaterloo.ca/eclipse/birt/update-site/2.6/
If you're running a Tycho build, this URL should be changed in your parent-pom.xml ...
<url>http://download.eclipse.org/birt/update-site/2.6/</url>
... or your .target platform file, depending on which way you're building.
<repository location="http://download.eclipse.org/birt/update-site/2.6/"/>
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: http://download.eclipse.org/athena/repos/.
4 comments:
...now how does one convince the P2 update UI for the same ?
Hi Nick,
since the mirror has the same metadata (artifacts.xml/content.xml) as eclipse.org, it still points back to download.eclipse.org 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 download.eclipse.org (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))
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.
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 download.eclipse.org 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.
Post a Comment