Ok, this is another question, but here goes:
You are pretty much on the right track, I tested the one you pointed out in the Karaf developer guide (second mvn call). The documentation is not entirely correct, I needed to change two things:
- The version is disabled, 2.2.5 works (on my machine), changing it to 2.2.8 seems to help.
- The name of the package is com.mycompany.package. Since the package is a keyword, this will not compile, so I changed it to com.mycompany.bundle.
So my archetype command:
mvn archetype:generate \ -DarchetypeGroupId=org.apache.karaf.archetypes \ -DarchetypeArtifactId=karaf-bundle-archetype \ -DarchetypeVersion=2.2.8 \ -DgroupId=com.mycompany \ -DartifactId=com.mycompany.bundle \ -Dversion=1.0-SNAPSHOT \ -Dpackage=com.mycompany.bundle
Then I went into the new project folder: com.mycompany.bundle:
cd com.mycompany.bundle
And installing mvn:
mvn install
Then in the "target /" folder there is a jar file that you can install in the Karaf installation, as I said.
Creating a package in Eclipse
Here is your jar file.
Frank lee
source share