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

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

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top