1

I want to start a fragment with the tycho-surefire-plugin. Simple, right?

<plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>tycho-surefire-plugin</artifactId>
    <version>${tycho-version}</version>
    <configuration>
        <providerHint>junit4</providerHint>
        <dependencies>
            <!-- I want to add my fragment here -->
        </dependencies>
    </configuration>
</plugin>

However, due to the missing documentation (or maybe it's hidden) I can't figure out what to enter:

<!-- this works for a plug-in -->
<dependency>
    <type>p2-installable-unit</type>
    <artifactId>org.eclipse.equinox.ds</artifactId>
</dependency>
<!-- this works for a feature -->
<dependency>
    <type>eclipse-feature</type>
    <artifactId>org.eclipse.e4.rcp</artifactId>
</dependency>
<!-- but a fragment? IDK -->
<dependency>
    <groupId>myGroup</groupId> <!-- I also tried without group -->
    <type>eclipse-fragment</type> <!-- I also tried the above types -->
    <artifactId>org.acme.module.fragment</artifactId>
    <version>${project.version}</version>  <!-- I also tried without version -->
</dependency>

How do I add a fragment to the Tycho Surefire plug-in?

Stefan S.
  • 3,950
  • 5
  • 25
  • 77

1 Answers1

3

Of course, fragments are resolved in an entirely different Tycho plug-in:

<plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>target-platform-configuration</artifactId>
    <configuration>
        <dependency-resolution>
            <extraRequirements>
                <requirement>
                    <type>eclipse-plugin</type>
                    <id>org.acme.module.fragment</id>
                    <versionRange>0.0.0</versionRange>
                </requirement>
            </extraRequirements>
        </dependency-resolution>
    </configuration>
</plugin>
Stefan S.
  • 3,950
  • 5
  • 25
  • 77
  • Well, according to [the plug-in documentation](https://eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#dependencies), you can **also** add them to the `tycho-surefire-plugin` ``, although it says that using the `target-platform-configuration` plugin is the preferred way. – Andreas Sewe Jul 20 '17 at 11:18
  • @AndreasSewe My question was exactly how to add them to the `tycho-surefire-plugin`. I can't figure out their type using that plug-in. – Stefan S. Jul 21 '17 at 09:46
  • [Looking at the code](http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java?h=tycho-1.0.0#n284), the `` element should be called ``. Each `` child thereof follows the standard Maven format: ``, ``, etc. – Andreas Sewe Jul 21 '17 at 13:56