How to setup for BND project starting with enRoute to run on ApacheFelix and OSGI 6?

208 Views Asked by At

I have tried to follow on the tutorials from enRoute and then customize them for OSGI 6.

I have a top project that is a generated as enRoute project and it has the enRoute dependencies and bnd maven plugins. I have added extra dependencies : osgi.core:6.0.0, org.apache.felix.gogo.runtime,shell,console

Also, there is a Maven module created as enRoute Application and that uses the top project as parent and imports the extra dependencies from there.

After running mvn package on the module, I get some errors:

[ERROR] Failed to execute goal biz.aQute.bnd:bnd-export-maven-plugin:4.1.0:export (default) on project my-bundle: null: MojoExecutionException:

Before this NullPointer, I see that bnd/maven is trying to collect dependencies and it does find my stuff : example.my-project.my-module, osgi.core, org.apache.felix.framework, org.apache.felix.gogo.shell, etc.

[DEBUG] my-module: adding resource javax.servlet-api version=3.1.0 version=9.4.15.v20190215 [DEBUG] my-module: adding resource org.apache.commons.fileupload version=1.3.3 [DEBUG] my-module: adding resource org.apache.commons.io version=2.6.0 [DEBUG] my-module: adding resource org.apache.felix.http.servlet-api version=1.1.2 [DEBUG] my-module: adding resource org.apache.felix.framework version=6.0.2 [DEBUG] my-module: adding resource example.my-project.my-module version=1.0.0.201905020747 [DEBUG] my-module: list(null) [org.apache.felix.http.jetty, org.apache.felix.gogo.shell, org.apache.felix.http.servlet-api, jaxb-api, osgi.core, org.apache.felix.framework, javax.servlet-api, example.my-project.my-module, org.osgi.service.http.whiteboard, org.apache.felix.gogo.command, org.apache.felix.configadmin, org.osgi.service.log, org.apache.felix.gogo.runtime, org.apache.felix.webconsole]

Then Maven is trying to update the runbundles with an error :

[DEBUG] init [DEBUG] Line is empty, args=C:/workspace/my-project/my-module/target/tmp/export/my-module/cnf/cache/4.1.0/bnd-cache [DEBUG] Original -runbundles was: \ org.apache.felix.gogo.shell;version=1.0.0,\ org.apache.felix.gogo.runtime;version=1.0.10,\ org.apache.felix.gogo.command;version=1.0.2,\ org.apache.felix.webconsole;version=4.3.4,\ org.apache.felix.http.jetty;version=4.0.6,\ org.apache.felix.http.servlet-api;version=1.1.2 [DEBUG] Resolved -runbundles is: null

Original -runbundles was filled by me by hand as I was trying to help bnd. But BND did not update with new ones (in fact, it did not update at all)

  1. Is this the correct way to include new bundles in your project? To add the them as dependencies (and later, the maven plugins from bnd will update my .bndrun files with entries in -runbundles)?
  2. What plugin updates the -runrequires in the .bndrun and where do I put my entries to get them read by BND?
  3. Same question for -buildpath in .bndrun
  4. Same question for -runfw in .bndrun
0

There are 0 best solutions below