musings of a Software Developer

Mirroring eclipse update sites


When you have resticted internet access at work, dealing with eclipse plugins can be a pain.
A lot of plugins don’t make local-update archives anymore, so you have to look for other solutions. I had a look at epmt( which is a nice, but not very stable application to mirror eclipse update sites. Unfortunately it uses apache httpClient to download source, while there is nothing wrong with this library, it doesn’t come with support for ntlm2 proxy authentication(java supports this from java 5 if i remember correctly so a bit strange it is not in there).

Apparently another way to mirror eclipse update sites is offered by the eclipse update manager itself.
You can start the update manager in a standalone mode to create a mirror of an update site by using
this command:

java -Dhttp.proxyHost=yourProxy -Dhttp.proxyPort=yourProxyPort -jar  plugins/org.eclipse.equinox.launcher_1.0.200.v20090520 -application org.eclipse.update.core.standaloneUpdate -command mirror -from %updateSiteToMirror% -mirrorUrl %urlOfYourUpdateSite% -to %fileLocationToMirrorTo%.

It even supports to create one mirror-site of multiple sites if you specify the same location for multiple sites it will append them to the site.xml giving you one big (and messy) update site.

An easy way to use this is use a dos or bash scipt ofcourse. I currently use the following script to mirror the relevant update site:

set LAUNCHER=C:\opt\springsource-2.1\sts-2.1.0.RELEASE\plugins/plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar

call updateSite subclipse
call updateSite pmd
call updateSite m2eclipse
call updateSite  findbugs
call updateSite  moreunit
call updateSite sprinsource-e35
call updateSite checkstyle
call updateSite atlassian
call updateSite commonclipse
call updateSite glassfish
call updateSite gmx-plugins
call updateSite regex
call updateSite ucdetector


java -Dhttp.proxyHost=yourProxy	-Dhttp.proxyPort=yourProxyPort -jar %LAUNCHER% -application org.eclipse.update.core.standaloneUpdate -command mirror -from %1 -mirrorUrl http://server/eclipseupdatesite/%2 -to Y:\%2 &goto:eof

This gives us multiple update sites under http://server/eclipseupdatesite/ like http://server/eclipseupdatesite/m2eclipse etc. Of course you still need 1 computer to have unrestricted internet access, but you can always create those sites at home.

Leave a Reply

Required fields are marked *.