I am trying to create a Karaf assembly using Maven (and NetBeans). I create my bundles using declarative services, but I am having problems creating feature files. Part of my problem is the error messages that OSGi generates. But I have a more general questions.
I have discovered that I can call karaf-maven-plugin
in the project that creates my bundles and it generates what appears to be a comprehensively populated feature file based on the dependencies of the bundle. (Method 1)
However, I have read somewhere that creating a feature file with karaf-maven-plugin
should normally only be done in a project with feature
packaging. If I do this, it seems to me that I have to create the feature file by hand, which is not a lot of fun. (Method 2)
No matter which method I use, I have been unable to successfully generate a Karaf assembly that contains anything other than simple bundles without any dependencies. I am currently stuck trying to install a single bundle that needs to wrap some non-OSGi dependencies. Method 1 above generates the wrap
stuff (<feature>
and wrap:
protocol). All I get is the following error:
Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.1.0:assembly (default-assembly) on project EnoceanBridgeAdmin: Unable to build assembly: [wrap/0.0.0]
EnoceanBridgeAdmin
is the karaf-assembly
packaging that I'm trying to build. It has a dependency on the bundle that contains the generated feature file (where wrap
is referenced):
<dependency>
<groupId>net.winnall.enocean.service.impl</groupId>
<artifactId>EnoceanBridgeSASS.Impl</artifactId>
<version>0.99.99</version>
<type>xml</type>
<classifier>features</classifier>
</dependency>
So my questions:
- Is method 1 above a correct usage?
- Can I automatically generate a feature file to use method 2?
- Will the error message disappear after I've got method 1 or 2 sorted?
Steve