Plugin Documentation

This report describes goals, parameters details, requirements and sample usage of this plugin.

Goals

Goals available for this plugin:

Goal Description
tycho-surefire:bnd-test Execute tests using BND testing
tycho-surefire:plugin-test Executes integration-tests in an OSGi runtime.

The goal launches an OSGi runtime and executes the project's integration-tests (default patterns are PluginTest*.class, *IT.class) in that runtime. The "test runtime" consists of the bundle built in this project and its transitive dependencies, plus some Equinox and test harness bundles. The bundles are resolved from the target platform of the project. Note that the test runtime does typically not contain the entire target platform. If there are implicitly required bundles (e.g. org.apache.felix.scr to make declarative services work), they need to be added manually through an extraRequirements configuration on the target-platform-configuration plugin.

This goal adopts the maven-failsafe paradigm, that works in the following way:

  1. pre-integration-test phase could be used to prepare any prerequisite (e.g. starting a web-server, creating files, etc.)
  2. integration-test phase does not fail the build if there are test failures but a summary file is written
  3. post-integration-test could be used to cleanup/tear down any resources from the pre-integration-test phase
  4. test outcome is checked in the verify phase that might fail the build if there are test failures

Summary files are generated according to the default maven-surefire-plugin for integration with tools that already work with maven-surefire-plugin (e.g. CI servers).
tycho-surefire:test

Executes tests in an OSGi runtime. This is only supported in modules of packaging type `eclipse-test-plugin`.

The goal launches an OSGi runtime and executes the project's tests in that runtime. The "test runtime" consists of the bundle built in this project and its transitive dependencies, plus some Equinox and test harness bundles. The bundles are resolved from the target platform of the project. Note that the test runtime does typically not contain the entire target platform. If there are implicitly required bundles (e.g. org.apache.felix.scr to make declarative services work), they need to be added manually through an extraRequirements configuration on the target-platform-configuration plugin.

tycho-surefire:verify Verifies plugin-test runs from the integration-test stage

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 3.9.0
JDK 17

System Requirements History

The following specifies the minimum requirements to run this Maven plugin for historical versions:

Plugin Version Maven JDK
from 4.0.0 to 4.0.9 3.9.0 17
from 3.0.0 to 3.0.5 - 17
from 2.0.0 to 2.7.5 - 11
from 0.25.0 to 1.7.0 - 8
from 0.23.0 to 0.24.0 - 7
0.22.0 - 6
from 0.12.0 to 0.21.0 - 5

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.eclipse.tycho</groupId>
          <artifactId>tycho-surefire-plugin</artifactId>
          <version>4.0.9</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-surefire-plugin</artifactId>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"