I am trying to wrap multiple osgi bundles into a single uber-jar bundle.
From some source bundles I want to strip the declarative services being defined in folder OSGI-INF.
I tried the following instructions in the bnd file:
But still the OSGI-INF from mybundle ends up in the resulting bundle. I guess this is because the services are referenced in the META-INF/MANIFEST.MF. For all other regular folders the exclusions work properly.
How can I build an uber-jar from multiple bundles but leaving out some declarative services? Is there some special instruction or bnd plugin for it or do I rather have to use something like maven-shade-plugin?
note that, with @bjhargrave 's suggestion, you can use negative package syntax to prevent only certain packages from being analyzed by certain plugins:
Thanks a lot for that pointer. Indeed the DS and metatype metadata were regenerated from the given bundle. For some reason I assumed that DS annotations had a SOURCE retention policy (RetentionPolicy (Java Platform SE 8 ))
With
-dsannotations:
-metatype:
I could disable generating DS component metadata but the metatype is still being generated for some reason…