I came across a good article by Sameera on "How to build OSGi bundles using Maven Bundle Plugin". It gives detailed infromation on how to use maven bundle plugin to generate OSGi bundles. In this blogpost, I will demonstrate how a sample can be run. If you are hungry for more information read the above article.
1) Download and extract the samples.
2) Build the sample01
mvn clean install3) Download Equinox.
eg: org.eclipse.osgi_3.5.0.v20090520.jar
4) Run the jar file using following command.
java -jar org.eclipse.osgi_3.5.0.v20090520.jar -console5) In the command prompt execute following command.
osgi> ss6) Install the bundle
Framework is launched.
id State Bundle
0 ACTIVE org.eclipse.osgi_3.5.0.v20090520
osgi> install file:/home/heshan/Documents/Work/OSGi/maven_bundle_plugin_samples_0/sample01/target/sample01-1.0.0.jar7) Use the following commands to start and stop the bundles.
Bundle id is 1
osgi> ss
Framework is launched.
id State Bundle
0 ACTIVE org.eclipse.osgi_3.5.0.v20090520
1 ACTIVE org.wso2.mbp.sample01_1.0.0
osgi> start 1
Hello World!!!
osgi> stop 1
Goodbye World!!!
No comments:
Post a Comment