Skip to main content
Jump to: navigation, search

Tycho/Additional Tools

The Tycho project provides additional tools that may be useful when working with Tycho.

tycho-p2-extras-plugin

The mirror goal of the tycho-p2-extras-plugin copies installable units (plus their corresponding artifacts) from one or more p2 repositories into the build directory. This goal is available since version 0.13.0.

Example usage:

Mirror the org.eclipse.rcp feature from the Indigo p2 repository to target/repository. Filter the platform-specific fragments to only include linux/gtk/x86_64 os/ws/arch.

<build>
	<plugins>
		<plugin>
			<groupId>org.eclipse.tycho.extras</groupId>
			<artifactId>tycho-p2-extras-plugin</artifactId>
			<version>${tycho-version}</version>
			<executions>
				<execution>
					<phase>prepare-package</phase>
					<goals>
						<goal>mirror</goal>
					</goals>
				</execution>
			</executions>
			<configuration>
				<source>
					<!-- source repositori(es) to mirror from -->
					<repository>
						<url>http://download.eclipse.org/releases/indigo/</url>
						<layout>p2</layout>
						<!-- sypported layouts are "p2-metadata", "p2-artifacts", and "p2" (for joint repositories) -->
					</repository>
				</source>

				<!-- starting from here all configuration parameters are optional -->
                                <!-- they are only shown here with default values for documentation purpose -->

				<!-- List of IUs to mirror. If omitted, allIUs will be mirrored. -->
				<!-- Omitted IU version element means latest version of the IU -->
				<ius>
					<iu>
						<id>org.eclipse.rcp.feature.group</id>
					</iu>
				</ius>
				<!-- The destination directory to mirror to. -->
				<destination>${project.build.directory}/repository</destination>
				<!-- Whether only strict dependencies should be followed. -->
				<!-- "strict" means perfect version match -->
				<followStrictOnly>false</followStrictOnly>
				<!-- Whether or not to follow optional requirements. -->
				<includeOptional>true</includeOptional>
				<!-- Whether or not to follow non-greedy requirements. -->
				<includeNonGreedy>true</includeNonGreedy>
				<!-- filter properties. E.g. filter only one platform -->
				<filter>
					<osgi.os>linux</osgi.os>
					<osgi.ws>gtk</osgi.ws>
					<osgi.arch>x86_64</osgi.arch>
				</filter>
				<!-- Whether to filter the resulting set of IUs to only -->
				<!-- include the latest version of each IU -->
				<latestVersionOnly>false</latestVersionOnly>
				<!-- don't mirror artifacts, only metadata -->
				<mirrorMetadataOnly>false</mirrorMetadataOnly>
				<!-- whether to compress the target repo -->
				<compress>true</compress>
				<!-- whether to append to the target repo content -->
				<append>true</append>
			</configuration>
		</plugin>
	</plugins>
</build>

The mojo has the same parameters as the p2.mirror ant task

tycho-eclipserun-plugin

This plugin allows to run an Eclipse application from Maven. This plugin is available since version 0.14.0. One use of this plugin is building the documentation index using Eclipse's antRunner and the help.buildHelpIndex Ant task.

Without Tycho, this would typically be done by having an Ant file with the help.buildHelpIndex task. For example, in customBuildCallbacks.xml:

<project name="Build specific targets and properties" default="noDefault">
	<target name="post.build.jars">
		<antcall target="build.index"/>
	</target>

	<target name="build.index" description="Builds search index for the plug-in: org.eclipse.someplugin.doc.user." if="eclipse.running">
		<help.buildHelpIndex manifest="plugin.xml" destination="."/>
	</target>
</project>

tycho-eclipserun-plugin can be used to run Eclipse's antRunner and reuse that Ant file.

org.eclipse.someplugin.doc.user/pom.xml:

<build>
	<plugins>
		...
		<plugin>
			<groupId>org.eclipse.tycho.extras</groupId>
			<artifactId>tycho-eclipserun-plugin</artifactId>
			<version>${tycho-version}</version>
			<configuration>
				<appArgLine>-application org.eclipse.ant.core.antRunner -buildfile customBuildCallbacks.xml build.index</appArgLine>
				<dependencies>
					<dependency>
					   <artifactId>org.apache.ant</artifactId>
					   <type>eclipse-plugin</type>
					</dependency>
					<dependency>
					   <artifactId>org.eclipse.help.base</artifactId>
					   <type>eclipse-plugin</type>
					</dependency>
				</dependencies>
			</configuration>
			<executions>
				<execution>
					<goals>
						<goal>eclipse-run</goal>
					</goals>
					<phase>compile</phase>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>

For other scenarios, it might be necessary to change the elements in <dependencies>. Also, note that the JVM arguments can be changed with the <argLine> paremeter.

Back to the top