Question

I have 3 projects:

  • Project A: An eclipse plugin
  • Project B: An eclipse plugin dependent on project A
  • Project C: An eclipse plugin containing SWTBot tests only to test project B

Project A is compiled via maven independently.

Then Project B and Project C are compiled together and in order to launch the tests, tycho is used.

The problem is when compiling project B and C via maven, I get the following error:

[ERROR] Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from B 1.0.0.qualifier to bundle A 0.0.0.", "No solution found because the problem is unsatisfiable."] -> [Help 1]

What should I do so that tycho will be aware of project A (available in the maven repository) when compiling project B and C?

Was it helpful?

Solution

Bundle B and C both (transitively) require bundle A. Therefore that bundle needs to be in the target platform configured for both bundle B and C. (The target platform is configured via nomal Maven POM configuration, so you would usually configure the target platform for both modules in the same way by adding the configuration to the parent POM.)

In order to add an Eclipse plug-in/OSGi bundle from a Maven repository to the target platform, you need to configure the following:

  • Declare a POM dependency to the plug-in/bundle (by adding dependency element with the artifacts GAV)
  • Set pomDependencies=consider on Tycho's target-platform-configuration plugin:

    <plugin>
       <groupId>org.eclipse.tycho</groupId>
       <artifactId>target-platform-configuration</artifactId>
       <version>${tycho-version}</version>
       <configuration>
          <pomDependencies>consider</pomDependencies>
       </configuration>
    </plugin>
    

Note that the artifact from the Maven repository needs to be an Eclipse plug-in or OSGi bundle, i.e. it needs to have a correct OSGi manifest. For more details on pomDependencies=consider, see this section of the target platform configuration documentation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top