1

How to convert a maven jar into an OSGI bundle? For this jar file, it also has dependencies on other external jar files. I tried maven-bundle-plugin, but how to write Import-Package is a disaster for me...... Can anyone help me out?

More specifically, what I want to transform is ProvToolbox https://lucmoreau.github.io/ProvToolbox/, which has several prov packages. So I need to transform them one by one.

Sooner
  • 101
  • 4
  • you could convert them one-by-one to osgi bundles, or use maven shade plugin to merge the code with its dependencies (rather risky, and confusing). dont forget to setup proper bundle initialization, afaik some code dont work well - forgot which one. – Bagus Tesa Feb 11 '20 at 13:36

2 Answers2

-1

Adding import packages is easy using the UI from Eclipse - just open the manifest, and in the Dependencies tab, you can add them.

This explains how to transform a JAR into an OSGi bundle: link

Andrei
  • 19
  • 4
-1

Here you have a perfect example to create a fat bundle with all transitiv dependecies.

https://github.com/apache/jackrabbit/blob/2.18/jackrabbit-bundle/pom.xml

Notice the following tag:

<Embed-Transitive>true</Embed-Transitive>
  • Be patient and wait a little. As sometimes I press the button to early. So let the people have time to edit their post. – Alexej Sailer Jun 06 '20 at 16:39