Questions tagged [maven-bundle-plugin]

Maven Bundle Plugin provides a maven plugin that supports creating an OSGi bundle from the contents of the compilation classpath along with its resources and dependencies.

The way BND works is by treating your project as a big collection of classes (e.g., project code, dependencies, and the class path).

The way you create a bundle with BND is to tell it the content of the bundle's JAR file as a subset of the available classes.
This plugin wraps BND to make it work specifically with the Maven 2 project structure and to provide it with reasonable default behavior for Maven 2 projects.

Check the official simple example for a first look at this plugin.

More info

133 questions
18
votes
3 answers

Should I use POM first or MANIFEST first when developing OSGi application with Maven?

There are two main approaches when developing an OSGi application with Maven: POM-first and MANIFEST first. I'm looking for an answer that is in a form of a table that shows pros and cons of each method. To be more specific, I would also like to…
Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265
16
votes
1 answer

Maven Bundle Plugin: Export has private references

After updating the maven-bundle-plugin from version 2.3.5 to version 2.4.0 running mvn clean install outputs some warning messages, which I don't fully understand. E.g. Export ch.entwine.weblounge.contentrepository.impl.index, has 1, private…
Basil
  • 638
  • 1
  • 9
  • 16
15
votes
3 answers

maven-bundle-plugin fails with "Invalid class file module-info.class"

After adding a dependency that contains a JPMS module, the maven-bundle-plugin (version 3.3.0) fails with: [INFO] --- maven-bundle-plugin:3.3.0:bundle (default-bundle) @ my-bundle --- [ERROR] Bundle myGroup:my-bundle:bundle:1.0 : Exception:…
gjoranv
  • 4,376
  • 3
  • 21
  • 37
15
votes
1 answer

OSGi and Transitive Dependencies

I’m using Felix Framework for my OSGi project, but I’ve came across a severe problem concerning third party dependencies. I’m using eclipse and maven-bundle-plugin to generate my bundles from the sources and the MANIFEST.MF from the POM.XML file. So…
PedroD
  • 5,670
  • 12
  • 46
  • 84
15
votes
4 answers

Using maven-bundle-plugin with the maven-shade-plugin

I'm using the maven-shade-plugin to relocate some packages during the package phase of my build. I'm also using the maven-bundle-plugin to generate a manifest. The problem is the bundle plugin runs before the shade plugin (during the process-classes…
Jonathan
  • 5,027
  • 39
  • 48
11
votes
1 answer

Installing OSGi dependencies with maven-bundle-plugin

I have a java project that compiles down to an OSGi bundle. I'm using the maven-bundle-plugin to create the bundle, and the maven-sling-plugin to push the bundle to my running OSGi server. At the moment, my project has two dependencies (Guava and…
matt
  • 9,113
  • 3
  • 44
  • 46
10
votes
3 answers

Use Maven to build OSGi application

I want to build an OSGi compliant multi-moduled application where I have all the required bundles in 3 folders after compilation. I am using maven-bundle-plugin and maven-scr-plugin to create the bundles. What I want is to run this application in an…
Jeewantha
  • 965
  • 1
  • 11
  • 28
10
votes
2 answers

Why (and in favor of what) are maven-bundle-plugin's wrap/bundleall goals deprecated?

http://svn.apache.org/repos/asf/felix/releases/maven-bundle-plugin-2.3.7/doc/site/wrap-mojo.html says bundle:wrap is deprecated, same with bundle:bundleall. I currently use wrap to create an OSGi bundle from a non-OSGi dependency, as described at…
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
9
votes
3 answers

OSGI number imports restriction

I'm building an OSGI base application, in one of my classes I do an important number of imports ( arround 30 ) and when i launch the app i get this exception : java.lang.ArrayIndexOutOfBoundsException: 18 at…
user1828433
  • 252
  • 2
  • 11
8
votes
1 answer

Maven-bundle-plugin: osgi.ee=UNKNOWN

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…
gjoranv
  • 4,376
  • 3
  • 21
  • 37
8
votes
1 answer

Abstract components via org.osgi.service.component annotations

I am migrating from org.apache.felix.scr annotations to org.osgi.service.component annotations. I have a set of Components that inherit from a common abstract class. In the felix case, I can use a @Component annotation with the option…
Igor P
  • 85
  • 1
  • 5
8
votes
2 answers

How to include resource file into osgi bundle from jar dependency with bnd/maven-bundle-plugin?

I'm using maven-bundle-plugin (bnd effectively). It's straightforward to include a resource file from sources. For example, a resource file (src/main/resources/some.xml) is moved under target directory (target/classes/some.xml) during build time and…
uvsmtid
  • 4,187
  • 4
  • 38
  • 64
6
votes
1 answer

How to embed a maven dependency with bnd-maven-plugin

I am moving from maven-bundle-plugin which provided the "convenient" configuration using Embed-Dependency, but it appears i need to specify my Embed Dependency "manually" in bnd format when using the bnd-maven-plugin. I added the same bundle headers…
empire29
  • 3,729
  • 6
  • 45
  • 71
5
votes
1 answer

OSGi Karaf Spring Boot 2.1.4-Release Error

I am trying to build an OSGi Karaf app using Spring Boot 2.1.4 with Java 8, OSGi version 5.0.0 and Apache Karaf 4.1.3. I have created the following project in GitHub which builds and runs fine when I use Spring Boot 1.5.9. But when I change the…
NikosDim
  • 1,398
  • 2
  • 21
  • 40
5
votes
3 answers

Build Failure: Version increase required: Failed to execute goal org.apache.felix:maven-bundle-plugin:3.0.1:baseline

Below is the error i am getting when i am adding any new method to existing code (especially when i am adding any method to interface or class) --- animal-sniffer-maven-plugin:1.15:check (default) @ deepser --- [INFO] Checking unresolved references…
KCS
  • 2,937
  • 4
  • 22
  • 32
1
2 3
8 9