Monthly Archives: January 2013

Eclipse p2 Site Mirroring

It’s often discussed and not really new. Here is the official page

If you mirrror a complete repo with f.e. this ant file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="test1" name="3rdparty-mirror">
	<property environment="env" />
	<property name="repo.dir" value="/srv/source/ci/3rdparty-mirror" />

	<macrodef name="runinmirror">
		<attribute name="repopath" default="NOT SET" />
			<echo message="Mirroring: @{repopath}: Begin" />
			<p2.mirror source="http://@{repopath}/" destination="${repo.dir}/@{repopath}/" />
			<echo message="Mirroring: @{repopath}: End" />

	<target name="test1">
		<echo message="Repo: ${repo.dir}" />
		<runinmirror repopath="" />
		<runinmirror repopath="" />
		<runinmirror repopath="" />
		<runinmirror repopath="" />
		<runinmirror repopath="" />
		<runinmirror repopath="" />
		<runinmirror repopath="" />


You can execute the file with the following scriptfile. After it is done, there is a repository with all its contents and the categories.

But if you do a selective mirror with this ant file:

<iu id=""/>

You loose the categories.
After the mirroring is done, you can configure the repositories categories with the script:

java -jar ${ECLIPSE_LAUNCHER} -application org.eclipse.equinox.p2.publisher.CategoryPublisher -nosplash -verbose -data ${WORKSPACE} -metadataRepository ${REPO_DIR} -categoryDefinition ${CATEGORY_FILE}

Perhaps there is another solution for the partial mirrroring?


Continuous integration

Here is a really good tutorial for continuous integration with Tycho and Hudson:

For eclipse features the most important point is that with the current version 0.16 a magic folder is needed, else the features are not build. With the current 0.17.0-SNAPSHOT version this issue is fixed.