Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Tycho/Migration Howto"
(→Adding p2 repositories to resolve external dependencies) |
(→Getting tests to run) |
||
Line 40: | Line 40: | ||
== Getting tests to run == | == Getting tests to run == | ||
+ | |||
+ | If your test bundle symbolic names end with <tt>.tests</tt>, the pom generator will acccordingly define | ||
+ | |||
+ | <pre> | ||
+ | <packaging>eclipse-test-plugin</packaging> | ||
+ | </pre> | ||
+ | |||
+ | This will tell Tycho to scan for test classes and execute them during build. Note that scanning is using class naming convention | ||
+ | |||
+ | <tt>**/Test*.java **/*Test.java **/*TestCase.java</tt> | ||
+ | |||
+ | For details, see the [http://eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html Tycho Surefire docs] | ||
+ | |||
+ | Tips: | ||
+ | |||
+ | * to skip test execution temporarily, use commandline option <tt>-DskipTests</tt> | ||
+ | * to debug tests, use commandline option <tt>-DdebugPort=8000</tt> | ||
+ | * in case you are using SWTBot, see [[SWTBot/Maven#With_Maven_and_Tycho|Running SWTBot tests with Tycho]] | ||
+ | * [http://eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#testSuite how to run a test suite] | ||
== Generating source bundles and features == | == Generating source bundles and features == |
Revision as of 07:34, 5 June 2013
This page is intended to give existing projects a jumpstart for setting up a Tycho build.
While each project is different, there are some common steps:
Contents
Scaffolding: generate pom.xml files
Maven needs pom.xml files to drive the build. See Generating POM files on how to generate an initial skeleton for these files.
Manual adjustments
In the generated top-level (parent) pom.xml, it's a good idea to globally define the tycho version to use
<properties> <tycho-version>0.18.0</tycho-version> </properties>
so you can reference it using ${tycho-version} anywhere in the child pom.xml files e.g. when configuring tycho plugins. See maven project inheritance.
In case you have deeply nested projects and used several generate-poms invocations, add a top-level parent pom.xml and reference it as parent from the intermediate parent poms. Also, adjust the modules to be built (see maven project aggregation).
Adding p2 repositories to resolve external dependencies
Almost every project has external dependencies it needs to compile against. Add all p2 repositories you need for compilation or runtime in the parent pom like in pom.xml the following snippet:
<repositories> <repository> <id>eclipse-juno</id> <layout>p2</layout> <url>http://download.eclipse.org/releases/juno</url> </repository> </repositories>
Getting tests to run
If your test bundle symbolic names end with .tests, the pom generator will acccordingly define
<packaging>eclipse-test-plugin</packaging>
This will tell Tycho to scan for test classes and execute them during build. Note that scanning is using class naming convention
**/Test*.java **/*Test.java **/*TestCase.java
For details, see the Tycho Surefire docs
Tips:
- to skip test execution temporarily, use commandline option -DskipTests
- to debug tests, use commandline option -DdebugPort=8000
- in case you are using SWTBot, see Running SWTBot tests with Tycho
- how to run a test suite