blob: 3b317bb7b087d478262afa8d9449c7b16d006915 [file] [log] [blame]
h1. Developing OSGi components with m2e and EIK
Most of the examples and archetype present on the web use maven-bundle-plugins to create bundle.
EIK is able to use these archetype through the help of M2E.
If m2e is not installed yet please download it from [m2e|http://download.eclipse.org/technology/m2e/releases].
Using Karaf-bundle-archetype a simple projects called simpleBundle.
We need to instruct maven-bundle-plugin configuration like this:
* manifestLocation to META-INF
* unpackBundle to true
{noformat}
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<manifestLocation>META-INF</manifestLocation>
<unpackBundle>true</unpackBundle>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-Activator>org.apache.karaf.eik.manual.simpleBundle.Activator</Bundle-Activator>
<Export-Package>
org.apache.karaf.eik.manual.simpleBundle*;version=${project.version}
</Export-Package>
<Import-Package>
*
</Import-Package>
</instructions>
</configuration>
</plugin>
{noformat}
* Right click on project -> Maven -> Update Project...
* Right click on project -> RunAs -> Maven install
from Debug Configurations is possible to see simpleBundle
!/images/devcomponentwithm2e_1.png!
Run Eik and to verify the installed bundle were started type osgi:list
!/images/devcomponentwithm2e_2.png!