Hi John,
You have different ways for that.
1/ if you have an Internet connection, you don't need this step. If you
can't download the bundles from Central (or other repositories), you
have to populate the Karaf system folder with the bundles that you want
to install at startup.
The system folder is a Maven repository (using the directory/file
structure groupId/artifactId/version/artifactId-version[-classifier].type).
So, to populate this folder
- do it by hand (copy respecting the Maven structure)
- use the mvn deploy:deploy-file with URL on the system folder
(-Durl=file:....)
- use the features-maven-plugin with the add-features-to-repo goal
2/ Once your system repo is populated, you can:
2.1/ install the bundle one by one, using the etc/startup.properties
2.2/ create a features XML (by hand or using the features-maven-plugin)
and define the features as a featuresBoot in
etc/org.apache.karaf.features.cfg. FYI, before Karaf 3.x, all features
XML are written by hand in Karaf itself.
3/ Once you have your system repo and etc files updated, you can package
your distribution.
I hope it helps.
Regards
JB
On 11/17/2013 04:37 PM, John D. Ament wrote:
HI all,
I'm using ServiceMix 4.5.3, which uses Karaf 2.2.11.
I'm essentially trying to start from a base karaf installation, and
install on top of it the custom bundles from ServiceMix + bundles my
application needs, so that the end result is a tar.gz with all of that
preconfigured and nothing else needed but to start up.
I'm able to get the packaging fine. I followed the instructions here:
http://karaf.apache.org/manual/latest-2.2.x/developers-guide/custom-distribution.html
For all of the base stuff, prebuilt features, the install works fine. I
see those getting installed at start up.
I then attempted to generate a features.xml for my bundle (right now I
just have a single JAR). This seems to not go well. The generated
features.xml, from feedback from others is wrong. Here's a gist of the
features.xml and the error: https://gist.github.com/johnament/7466114
A few things I've noticed.
1. even though many JARs are listed, my JAR file is not listed. Is this
expected?
2. The biggest error seems to be that it generated a features 1.2 XML
file. I'm told this is wrong. I generated this XML file using this
plugin config:
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>features-maven-plugin</artifactId>
<version>2.2.11</version>
<executions>
<execution>
<id>generate</id>
<phase>generate-resources</phase>
<goals>
<goal>generate-features-xml</goal>
</goals>
<configuration>
<kernelVersion>2.2.11</kernelVersion>
<outputFile>target/features.xml</outputFile>
</configuration>
</execution>
</executions>
</plugin>
Which I would assume the 2.2.11 version of the plugin is compatible with
Karaf 2.2.11.
Thanks for any feedback you can give. This is honestly my first time
dealing with Karaf & OSGi.
John
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com