1

I'm trying to deploy OpenAPI generated code in Karaf.

Karaf says I need:

javax.annotation.meta;version="[3.0,4)"
javax.xml.bind.annotation;version="[2.3,3)"

I'm using Java 1.8 to compile, and to run the code.

I'm using maven-bundle-plugin v3.5.1

No matter what I do, I end up with this line in my MANIFEST.MF

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

which I think is possibly the root of the issue.

Is there a way to force Require-Capability to use Java 8?
Or some better workaround?

djb
  • 1,635
  • 3
  • 26
  • 49
  • are you sure you're using java 1.8 to compile? bndtools (used by maven-bundle plugin) scans all of the classes on the classpath and keeps track of the class file version. This is the default behaviour, you can override it using <_noee>true instruction in your maven bundle plugin configuration – Federico Cerruto Sep 02 '20 at 17:17

1 Answers1

3

bndtools (used by maven-bundle plugin) scans all of the classes on the classpath and keeps track of the class file version. This is the default behaviour, you can override it using <_noee>true</_noee> instruction in your maven bundle plugin configuration

  • Thanks, it didn't fix it, but have an upvote. I ended up working around it by using the CLI to generate the POJO and API files for CXF+Jackson instead. The _noee still generated the Java 9 requirement. It seems like the problem has something to do with OkHttp+Gson dependencies, somewhere deep down, but I don't have time to look at it further. CXF+Jackson probably more simple and reliable anyway. – djb Sep 10 '20 at 11:57