2

My tycho surefire test application requires more bundles than which are automatically added through tycho dependency handling.

I could add all bundles as Require-Bundle in the MANIFEST.MF of the test bundle, but this seems like not a very clean solution.

I would prefer to add a feature to the tycho-surefire-plugin configuration, where all bundles of the feature will be automatically added to the:

target/work/configuration/config.ini osgi.bundles

Is it possible to add a feature or otherwise a list of additional bundles?

flavio.donze
  • 7,432
  • 9
  • 58
  • 91

1 Answers1

0

If you don't want to add them as required bundles, you can "enrich" the target platform for the test project by using "Extra Requirements" in the target-platform-configuration of the test project.

For example, something like

<plugin>
  <groupId>org.eclipse.tycho</groupId>
  <artifactId>target-platform-configuration</artifactId>
  <configuration>
    <dependency-resolution>
      <extraRequirements>
        <requirement>
          <type>eclipse-feature</type>
          <id>example.project.feature</id>
          <versionRange>0.0.0</versionRange>
        </requirement>
      </extraRequirements>
    </dependency-resolution>
  </configuration>
 </plugin>

In this example, you're adding an Eclipse feature (by the way, this is also the only way to have a feature when running Tycho surefire), an Eclipse plugin, etc.

Remember, this will affect only the current test project.

lorenzo-bettini
  • 2,106
  • 1
  • 16
  • 11