您可以将捆绑包放入“deploy”目录,而Karaf只是注意并安装它。
Ok, that is another question, but here goes:
You're pretty much on the right track, I've tested the one in the Karaf developers guide you linked to (the second mvn call). The documentation isn't quite correct, I needed to change two things:
So my archetype command was:
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 entered the newly made project folder: com.mycompany.bundle:
cd com.mycompany.bundle
And a mvn install:
mvn install
Then there is a jar file in the 'target/' folder, which you can install into the Karaf installation as I said before.
New -> Plugin Project -> Choose a name -> check the parameters -> you can use a template if you like.
Select your project -> Export -> Plugin/Fragment -> Choose a folder
There's your jar file.
Frank's answer helped me quite fast:
I created a bundle with this archetype:
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 did a mvn eclipse:eclipse
and mvn install
.
After copying the generated jar into the deploy directory of my running JBoss Fuse server it printed "Starting the bundle".
:-)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.