Dependencies from pom.xml not considered by Eclipse in Tycho Project

前端 未结 3 1448
不思量自难忘°
不思量自难忘° 2020-12-05 20:14

I created a Tycho project with an eclipse-plugin packaging. The project includes some dependencies that are specified via pom.xml. The relevant pom sections are

3条回答
  •  攒了一身酷
    2020-12-05 20:31

    You can circumvent this problem splitting your project build into two parts:

    • First, aggregate your POM dependencies into a p2 repository. You'll need an eclipse-feature and an eclipse-repository module for this, plus a separate parent POM that lists the POM dependencies and configures pomDependencies=consider.
    • In the second build, add the p2 repository from the first build to the target platform, e.g. via a jar:file: URL pointing to the build result in your local Maven repository.

    Then, you can also configure your target platform in Eclipse to include the p2 repository from the first build (which depends on how you currently configure it). You'll get the best consistency between Tycho and Eclipse if you use a so-called target definition file, which you can use both as target platform in Eclipse and in Tycho.

    I am aware that all this is quite a bit of effort to set up, but AFAIK there are no better solutions that fully work.

提交回复
热议问题