Eclipse p2 Site Mirroring

It’s often discussed and not really new. Here is the official page http://wiki.eclipse.org/Equinox/p2/Ant_Tasks

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" />
		<sequential>
			<echo message="Mirroring: @{repopath}: Begin" />
			<p2.mirror source="http://@{repopath}/" destination="${repo.dir}/@{repopath}/" />
			<echo message="Mirroring: @{repopath}: End" />
		</sequential>
	</macrodef>

	<target name="test1">
		<echo message="Repo: ${repo.dir}" />
		<runinmirror repopath="subclipse.tigris.org/update_1.6.x" />
		<runinmirror repopath="subclipse.tigris.org/update_1.8.x" />
		<runinmirror repopath="download.eclipse.org/releases/indigo" />
		<runinmirror repopath="download.eclipse.org/eclipse/updates/3.7" />
		<runinmirror repopath="download.eclipse.org/tools/orbit/downloads/drops/R20130118183705/repository" />
		<!-- 
		<runinmirror repopath="download.eclipse.org/releases/juno" />
		<runinmirror repopath="download.eclipse.org/eclipse/updates/4.2" />
		 -->
	</target>

</project>

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="org.eclipse.equinox.sdk.feature.group"/>

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?

b3aggr: http://wiki.eclipse.org/Eclipse_b3/aggregator/manual

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>