Maven-bundle-plugin: osgi.ee=UNKNOWN
Asked Answered
C

1

8

When building my OSGi bundles with JDK 10, maven-bundle-plugin (3.5.1) generates the following manifest attribute:

Require-Capability: osgi.ee;filter:="(osgi.ee=UNKNOWN)"

This fails runtime:

Unresolved requirements: [[com.mycompany.mybundle [1](R 1.0)] osgi.ee; (osgi.ee=UNKNOWN)]

When building with JDK 9, I get the expected:

Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9.0))"

I set the source and target versions for maven-compiler-plugin to '1.9' and '10' respectively.

At the moment, I'm using a workaround to stop the plugin from adding osgi.ee to the manifest:

<configuration>
  <instructions>
      <_noee>true</_noee>
  </instructions>
</configuration>

.. but I would rather have the correct Java 10 requirement.

Carty answered 2/7, 2018 at 14:16 Comment(0)
R
11

You need a more recent version of maven-bundle-plugin based upon Bnd 4.0 which added support for Java 10 class files.

Raychel answered 3/7, 2018 at 12:53 Comment(2)
It turns out the latest version of maven-bundle-plugin available as of today is 3.5.1 which is only based upon Bnd 3.5. So you need to get the maven-bundle-plugin devs to update. Or you can migrate to bnd-maven-plugin from the Bnd team. But note that is it configured and operates in a different way than maven-bundle-plugin.Raychel
Thanks, I created issues.apache.org/jira/browse/FELIX-5879 to follow up with the Felix team.Carty

© 2022 - 2024 — McMap. All rights reserved.