I'm working on provisioning a project of mine for Apache Karaf. One of the
customer's requirements is that deployment should also be as simple as
possible so I want to create a feature repository to do this.

My project is a Maven project consisting of a parent project with four
sub-modules. Each of the sub-modules packages to a bundle. Each of those
sub-modules have dependencies on third-party bundles which are expected to
exist in the Karaf container.

I want to be able to automatically generate a feature repository xml file
containing a feature for each of the four sub-module bundles. Each feature
would consist of a reference to the bundle as well as references to the
dependencies listed in that bundle's pom.xml file.

I *thought* that the /karaf-maven-plugin/ could be used as follows:

- Create a new module called project-feature-repository
- Set its packaging to *feature*
- Add the karaf-maven-plugin with default settings
- Set four dependencies (one for each of the other bundle modules)
- Run mvn package
- The generated feature.xml would then contain four features. One feature
for each of the four dependencies.

However, when I try this, the generated feature.xml contains a single
feature containing ALL of the four modules AND their transitive
dependancies.

I've noticed that the default behaviour is
<addBundlesToPrimaryFeature>true</addBundlesToPrimaryFeature>
which is clearly not what I want.

My question is: how can I use the karaf-maven-plugin to automatically
generate my feature repository containing four features where each feature
consists of one of my project's four modules (packaged as bundles) as well
as all of the dependencies for that module.

It strikes me that this should be a common scenario so I am sure there are
best practices for this!

Many thanks,
Oli



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Can-karaf-maven-plugin-generate-a-feature-repository-tp4032935.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to