How to create OSGi Bundle from existing JAR library using Maven

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to create OSGi Bundle from existing JAR library using Maven

Miroslav Nachev-2
Hi,

Using Maven I need to create one OSGi Bundle from existing JAR file
which is on my computer (not on the network). Is there any easy and fast
way for that?


Regards,
Miro.
Reply | Threaded
Open this post in threaded view
|

Re: How to create OSGi Bundle from existing JAR library using Maven

Jean-Baptiste Onofré
 Hi Miro,

 you can use felix/bnd to do it.

 You create a pom.xml like this :

 <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/maven-v4_0_0.xsd">

 <modelVersion>4.0.0</modelVersion>

 <groupId>yourgroup</groupId>
 <artifactId>youartifact</artifactId>
 <name>My OSGi bundle</name>
 <version>1.0</version>
 <packaging>bundle</packaging>

 <dependencies>
 <groupId>group</groupId>
 <artifactId>artifact</artifactId>
 <version>${pom.version}</version>
 </dependencies>

 <build>
 <plugins>
 <plugin>
 <groupId>org.apache.felix</groupId>
 <artifactId>maven-bundle-plugin</artifactId>
 <extensions>true</extensions>
 <configuration>
 <instructions>
 <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
 <Export-Package>
 my.package.*;version=${pom.version}
 </Export-Package>
 <Import-Package>
 my.other.bundle.*;version=1.0,
 sun.io;resolution:=optional
 </Import-Package>
 </instructions>
 </configuration>
 </plugin>
 </plugins>
 </build>

 </project>

 Regards
 JB
 --
 Jean-Baptiste Onofré
 [hidden email]
 BuildProcess/AutoDeploy Project Leader
 http://buildprocess.sourceforge.net

 On Tue 18/11/08 10:50, Miroslav Nachev [hidden email] wrote:
 Hi,

 Using Maven I need to create one OSGi Bundle from existing JAR file
 which is on my computer (not on the network). Is there any easy and
fast
 way for that?

 Regards,
 Miro.

Reply | Threaded
Open this post in threaded view
|

Re: How to create OSGi Bundle from existing JAR library using Maven

Jean-Baptiste Onofré
In reply to this post by Miroslav Nachev-2
 Other thing,

 If you need to use the jar file localy to your computer, you can
install in your local m2 repository using :

 mvn install:install-file

 Regards
 JB
 --
 Jean-Baptiste Onofré
 [hidden email]
 BuildProcess/AutoDeploy Project Leader
 http://buildprocess.sourceforge.net

 On Tue 18/11/08 10:50, Miroslav Nachev [hidden email] wrote:
 Hi,

 Using Maven I need to create one OSGi Bundle from existing JAR file
 which is on my computer (not on the network). Is there any easy and
fast
 way for that?

 Regards,
 Miro.