Johnson
Johnson

Reputation: 358

Can you reference OSGi dependencies resolved by Tycho by groupId, artifactId and version?

In a Tycho build OSGi dependencies are usually specified in the MANIFEST.MF of the respective modules (e.g., Eclipse plugins). As far as I understand, Tycho identifies those dependencies, resolves them and adds them to the maven build model at build time (sorry for the wayback machine link; the Tycho site seems to undergo some changes right at the moment).

Is it possible to reference such a derived dependency in other maven plugins? For example, if I want to copy particular dependencies with maven-dependency-plugin how would I get to know which groupId, artifactId and version I would have to provide?

Upvotes: 1

Views: 411

Answers (1)

kapex
kapex

Reputation: 29989

Tycho has its own dependency resolution mechanism which is different from Maven's. Tycho loads dependencies defined in the Manifest from p2 repositories and not from Maven repositories (at least usually*). Maven artifacts and p2 bundles have different meta-data structures so you can't always map them to each other. For example bundles don't have the concept of group/artifact ID.

Regular Maven plugins can only handle regular Maven dependencies. p2 artifacts are not visible to them.

Depending on what you are trying to achieve, you could try to convert p2 bundles to Maven dependencies first, and then process them with Maven plugins. For your specific example this might help, if you don't mind splitting the build into multiple steps: Use dependencies from Eclipse p2 repository in a regular Maven build?

* You can configure Tycho with pomDependencies=consider to include Maven artifacts. Those would be visible to regular Maven plugins, but I would not recommend doing that, it makes building/deploying harder the more complex the build gets

Upvotes: 1

Related Questions