<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd
">
<modelVersion>4.0.0</modelVersion>
<groupId>theGroupId</groupId>
<artifactId>theArtifactId.osgi-wrapped</artifactId>
<version>theVersion</version>
<packaging>bundle</packaging>
<name>${artifactId}</name>
<description>${artifactId}</description>
<dependencies>
<dependency>
<groupId>theGroupId</groupId>
<artifactId>theArtifactId</artifactId>
<version>theVersion</version>
</dependency>
<!-- TODO:
Add any other dependencies you want to embed here,
then make sure to include their artifactIds
in the space-separated list in <Embed-Dependency>
below.
-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.5</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>*;resolution:=optional</Import-Package>
<_exportcontents>*</_exportcontents>
<Embed-Dependency>theArtifactId</Embed-Dependency>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
Monday, October 03, 2011
Convenient Maven POM to wrap jars for OSGi
I've been doing some OSGi work at my current gig. If you ever have a jar that isn't OSGi-ready, this is a handy-dandy little pom.xml that will use bnd (via maven-bundle-plugin) to wrap the jar, and any dependencies you want to include, in an OSGi bundle jar. Just replace theGroupId with the groupId, theArtifactId with the artifactId and theVersion with the version of the Maven artifact you want to wrap et voila.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment