OSGi stands for Open Service Gateway initiative. For daily development of OSGI bundles, we need to understand how it build and deployed. I have a simple camel osgi project which comes with camel 2.10.4 in examples/apache/camel/camel-example-osgi. In this short blogger, I want to explain what happened when you build and deploy the osgi bundle.
Here are the simple procedures I build and deploy the bundle:
cd ${apache-camle-home}/examples/apache/camel/camel-example-osgi mvn clean install
Where the build Requests?
You should see the following lines at the end of the build.
[INFO] --- maven-bundle-plugin:2.3.7:install (default-install) @ camel-example-osgi --- [INFO] Installing org/apache/camel/camel-example-osgi/2.10.4/camel-example-osgi-2.10.4.jar [INFO] Writing OBR metadata [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1:11.876s [INFO] Finished at: Sun Feb 02 16:04:17 CST 2014 [INFO] Final Memory: 26M/435M [INFO] ------------------------------------------------------------------------
This means the build is successful. But what has maven done? if you cd to you maven repository, which normally is located at $HOME/.m2/reposity. In my case, it is under:C:\Users\gliu\.m2\repository\org\apache\camel\camel-example-osgi\2.10.4You can see that:org.apache.camel --> groupID camel-example-osgi --> artifact ID 2.10.4 --> version numberUnder that directory you should see the following files:camel-example-osgi-2.10.4.pom camel-example-osgi-2.10.4-features.xml camel-example-osgi-2.10.4.jar _remote.repositoriesHow to deploy the artifact to OSGi container
The deployment is straight forward. In the karaf container command line, you can type the following:osgi:install mvn:org.apache.camel/camel-example-osgi/2.10.4 start 438Where 438 is bundle id. Here is a windows snapshot:
ReplyDeleteThank you for sharing wonderful information with us to get some idea about it.
Mule Training
Mule Certification
Mulesoft Training in Hyderabad
Mulesoft Training in Bangalore
Mulesoft Training Hyderabad
Best Mulesoft Online Training
Best Mulesoft Training
Mulesoft Course Online
Mulesoft Training and Certification
Mulesoft Architecture Certification
Mulesoft Course
Mulesoft Developer Certification
Mulesoft Self Learning
Mulesoft Online Training in India