I want to make the build process for my Eclipse RCP plugin fully automatic. It has some third-party jar dependencies (available from Maven repositories) which are not distributed as OSGi bundles, and currently I use the "Eclipse plugin from existing JAR archives" wizard to convert them manually. Can PDEBuild or Maven/Tycho (or perhaps some other build system) do it as a step of the build?
Asked
Active
Viewed 1,726 times
3 Answers
4
Peter Tillemans mentioned the PAX wrap jar command in this post
The Maven bundle plugin from Apache Felix may be worth a look, too.
Maybe the Bundlor tool from SpringSource can handle the creation of osgi bundles from jar, too.
-
once you have an OSGi bundle available as maven artifact, check https://docs.sonatype.org/display/TYCHO/Dependency+on+pom-first+artifacts on how to use them from tycho. – jsievers Jul 04 '11 at 11:51
3
Checkout the p2-maven-plugin developed by me. It's an open-source, community-friendly plugin that handles:
- the wrap of the jars that are not OSGi bundles (that's fully customizable)
- the generation a fully functional p2-update site that may be consumed in the Eclipse PDE
- the generation of the corresponding source bundles (it generates source bundles for all the bundles)
Details and the documentation could be find here: http://projects.reficio.org/p2-maven-plugin/manual.html
Sample usage:
<plugin>
<groupId>org.reficio</groupId>
<artifactId>p2-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<executions>
<execution>
<id>default-cli</id>
<configuration>
<artifacts>
<!-- specify your depencies here -->
<!-- groupId:artifactId:version -->
<artifact><id>commons-io:commons-io:2.1</id></artifact>
<artifact><id>commons-lang:commons-lang:2.4</id></artifact>
<artifact><id>commons-lang:commons-lang:2.5</id></artifact>
<artifact><id>commons-lang:commons-lang:2.6</id></artifact>
<artifact><id>org.apache.commons:commons-lang3:3.1</id></artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>

tom.bujok
- 1,612
- 2
- 13
- 20
0
Take a look on the differences between the thirdparty jar and its bundled equivalence. It's just an additional plugin.xml and a few extra lines in the manifest.
Write your own code for bundling jars.

Markus
- 809
- 5
- 10
-
2I disagree: Writing a correct OSGi manifest for a Java library is hard in most cases. – oberlies Sep 11 '12 at 16:21