0

I have a bunch of java classes and a bundle activator class that I need to deploy to karaf.

I see that the karat-maven-plugin has kar packaging and karaf-assembly.

Also it generates features.xml

I can generate features.xml directly and it generates lines with wrap: for some of my dependent non-osgi jars.

But when I run karat-assembly, I run into the issue of the assembly goal not realizing that these jars are not osgi and end up with errors.

What it the recommended way to get a custom karaf with my application installed ?

Does the karat-assembly packaging need to have a features.xml generated and provided beforehand ? Or is it supposed to do the feature set generation by itself ? If it is the latter, then how do I get around the problem of the karat-assembly not recognizing non-osgi jars ?

I have spent a LOT of time with google and am stumped.

treefrog
  • 1,027
  • 1
  • 15
  • 30

1 Answers1

2

This is my procedure for creating a custom karaf distribution. It may not be "best practice" but it works for me. Maybe you can customize for your needs.

  1. After developing my Camel routes and testing I generate my feature file based on a feature template found in /src/main/feature/feature.xml. The karaf-maven-plugin will generate the feature will in the feature folder inside /target.
  2. I do a clean deploy to our maven artifactory.
  3. I have a custom Karaf project do a clean install on that project. The project has dependencies to the initial project and I add all the features as boot level feature.
  4. Once build I unzip the distribution and run the Karaf app. If everything looks ok its ready to be shipped.
Souciance Eqdam Rashti
  • 3,143
  • 3
  • 15
  • 31
  • Ok so you generate your feature.xml with projectA and pom- with a feature generate packaging. Install projectA into repo and then have a to projectA ... so far I think I understand. Hope I don't tie myself into more knots. If you have a sample zip to share- would help. Thankyou – treefrog Nov 28 '16 at 00:27
  • Yeah exactly, you can look at my github account for a basic example..https://github.com/SoucianceEqdamRashti/Integration , let me know if you need more help on this. Took me a while to get to work as well ;) – Souciance Eqdam Rashti Nov 28 '16 at 08:40