Search code examples
osgitycho

OSGi Require-Capability and Tycho


I created an eclipse plugin that requires a certain capability in its manifest:

Require-Capability: osgi.service;filter:="(osgi.service=my.client.SessionService)"

My target platform contains another bundle that provides this capability. When I try to build this with Tycho I'm getting the following exception:

[ERROR] Internal error: java.lang.RuntimeException: org.osgi.framework.BundleException: Bundle my.client.rxp cannot be resolved
[ERROR] Resolution errors:
[ERROR] Bundle my.client.rxp - Missing Constraint: Require-Capability: osgi.service; filter="(osgi.service=my.client.SessionService)"

It seems that Tycho cannot handle OSGi Capabilities. Everything works fine as soon as I add the bundle that provides the capability as a required bundle to my eclipse plugin. But this makes no sense since the eclipse plugin shouldn't have any dependency to another implementation bundle. How can OSGi Capabilities be used in a Tycho build?


Solution

  • This is most probably caused by a bug in p2:

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=313553

    which Tycho uses to resolve dependencies.