I am trying to convert a bundle of ours that now simply imports jars for
Elasticsearch and make it a p2 site with p2-maven-plugin that usesthe
maven-bundle-plugin/bnd to wrap non-OSGi jars.

I ended up with resolution errors since ES has about 7-8 split packages,
most notably org.elasticsearch.client and org.elasticsearch.common. So I
went searching for solutions that I've seen before but never had to use
them. I cam across
https://eclipsesource.com/blogs/2008/08/22/tip-split-packages-and-visibility/
from Chris and http://web.ist.utl.pt/ist162500/?p=65.

I first tried to simply create a "bridge" bundle that simply requires the
ES bundles and re-export them and import the bridge bundle from my "search
bundle". That didn't solve the problem, same issue with imports of
split-packages.

Next I added attribute and mandatory, even if here I was relying on
require-bundle (not what I normally do). In my bridge bundle I added all
the over 300 export-package for the 5 ES bundles, w/o any extra. This
resulted in an error for each export of the form: Package
'org.elasticsearch.action.admin.cluster.allocation' does not exist in this
plug-in. In the search bundle, with a require bundle of the bridge bundle,
w/o the export packages it would not resolve any ES package and with them
in (even with the error) the only issues were with the split package. I
also tried in the search bundle to instead import the packages, with the
same result.

I'm getting to the point where I feel I might just have to either go back
to the original approach or create a bundle that just handles the ES
dependencies with bundle-classpath and export-pacakges of all those.

Any idea where I'm going wrong?

Thanks
Alain
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to