0

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?

Adel Boutros
  • 10,205
  • 7
  • 55
  • 89

1 Answers1

1

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.

oberlies
  • 11,503
  • 4
  • 63
  • 110
  • Hi oberlies, Thank you for your answer. The problem is that project A was generated by maven with NO reference to tycho plugins. I am not allowed to add a dependency in the poms. Therefore I was thinking of creating a "local eclipse plugin repository" by creating a new project as a feature project (Here I can add dependency to tycho) and a update site project which will be available for Project B and C. What do you think? – Adel Boutros Jul 02 '13 at 08:44
  • A just needs to be an OSGi bundle and deployed to a Maven repository. A doesn't need to know anything of Tycho whatsoever. – oberlies Jul 02 '13 at 13:37
  • Ok thanks. Actually I forgot to include the manifest of A when compiling with maven. So tycho was not recognizing A as a bundle. – Adel Boutros Jul 02 '13 at 14:05