I've added the bnd-maven-plugin to generate the necessary Manifest content, like
Bundle-Version
Bundle-Symbolic-Name
Require / Provide-Capability
WebJars-Resource
WebJars-Resource can be used in an OSGi environment to find WebJar bundles with a BundleTracker and register their resources at a HttpService.
Require-Capability is redeclaring the dependencies that are also used by maven, but in a format that the OSGi resolver can use to automatically resolve those dependencies.
The Bundle-Version has to be set manually if the ${project.version} is not OSGi compatible, e.g. a version like this: 1.2.3-2-SNAPSHOT. Bnd would ignore the "-2-" part and create the version like this: 1.2.3.SNAPSHOT, where probably something like 1.2.3.2-SNAPSHOT would be preferred. Therefore I had to create a new property bnd.bundle.version that is set to 1.2.3.2-SNAPSHOT to achieve this.
I've added the bnd-maven-plugin to generate the necessary Manifest content, like
WebJars-Resource can be used in an OSGi environment to find WebJar bundles with a
BundleTracker
and register their resources at aHttpService
.Require-Capability is redeclaring the dependencies that are also used by maven, but in a format that the OSGi resolver can use to automatically resolve those dependencies.
The Bundle-Version has to be set manually if the
${project.version}
is not OSGi compatible, e.g. a version like this: 1.2.3-2-SNAPSHOT. Bnd would ignore the "-2-" part and create the version like this: 1.2.3.SNAPSHOT, where probably something like 1.2.3.2-SNAPSHOT would be preferred. Therefore I had to create a new propertybnd.bundle.version
that is set to 1.2.3.2-SNAPSHOT to achieve this.