Prerequisites
- Java5 or better
- m2eclipse 0.9.6 or better
Configure ~/.m2/settings.xml
...
<repository>
<id>forge</id>
<url>http://repository.sonatype.org/content/groups/public</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
...
<pluginRepository>
<id>forge</id>
<url>http://repository.sonatype.org/content/groups/public</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
...
Workspace configuration
Window->Preferences->Maven
Goals to run on project import: process-test-classes
Goals to run when updating project configuration: process-test-classes
Checkout
File->Import->Other->Check out Maven project from SCM
Select SVN URL http://svn.sonatype.org/m2eclipse/tycho/trunk (use https for dev access)
This will checkout, create and configure all tycho projects in eclipse workspace.
Revert changes .project and .classpath files in tycho-surefire-osgi-booter
project (a workaround for m2e limitation).
At this point all projects should compile without errors and workspace is ready
Running tycho from workspace
- Download maven 3.0 distribution used by Tycho trunk as specified in Tycho builds and unzip it to an empty folder
- Add the maven distribution to the list of maven installations known to m2e (Window->Preferences->Maven->Installations)

As an example, run tycho integration tests using tycho
- Right-click on tycho-its project, Run As->Maven build... (note three dots). This will show Maven launch configuration edit window
- On the Main tab, specify "clean test" goals, enable "Resolve workspace artifacts", set tycho.targetPlatform property and select proper maven 3.0 installation

- On the Common tab, select Save as Share file and specify /tycho-its location

- Apply and close the dialog. Do NOT run it yet
- On the Main tab, specify "clean test" goals, enable "Resolve workspace artifacts", set tycho.targetPlatform property and select proper maven 3.0 installation
- Open /tycho-its/tycho-its.launch in text editor and add the following listAttribute to enable use of tycho by this launch configuration.
<listAttribute key="M2_FORCED_COMPONENTS_LIST"> <listEntry value="org.codehaus.tycho:tycho-osgi-components:0.4.0-SNAPSHOT"/> <listEntry value="org.eclipse:org.eclipse.osgi:3.5.0.v20090429-1630"/> <listEntry value="org.sonatype.tycho:tycho-p2-facade:0.4.0-SNAPSHOT"/> <listEntry value="org.sonatype.tycho:tycho-equinox:0.4.0-SNAPSHOT"/> </listAttribute>
- Put a breakpoint at EclipseMaven#getProjects to see m2e runs the right code
- Right-click on /tycho-its/tycho-its.launch, Debug As->tycho-its
m2eclipse is expected to launch tycho build in debug mode and stop execution at EclipseMaven#getProjects.
Comments (2)
May 08, 2009
Will Horn says:
Under the "Checkout" step, I had to revert .classpath for org.sonatype.tycho.p2....Under the "Checkout" step, I had to revert .classpath for org.sonatype.tycho.p2.maven.repository and xtream-osgi to get the build working.
May 08, 2009
Will Horn says:
To run tycho-its, I had to uncheck "Resolve Workspace artifacts" in the launch c...To run tycho-its, I had to uncheck "Resolve Workspace artifacts" in the launch configuration. This was due to https://issues.sonatype.org/browse/MNGECLIPSE-1224