> the Maven PDE/M2E stuff is not sophisticated enough to provide good OSGi metadata out of the box > IMO it can only be used for "simple" jars (not doing any fancy class loading stuff)

the user can always tweak the BND instructions, it should even possible to supply fragment-host headers there if desired.

With latest eclipse + m2e snapshot one can even have individual meta-data for dependencies.

Am 06.05.21 um 16:45 schrieb Gunnar Wagenknecht:
Hi Lars,

The stack trace above leads me to hypothesis that the Java ServiceLoader pattern is used. 
There are multiple ways to make it work but both require providing proper OSGi metadata, 
i.e. the Maven PDE/M2E stuff is not sophisticated enough to provide good OSGi metadata 
out of the box. IMO it can only be used for "simple" jars (not doing any fancy 
class loading stuff) or jars providing proper metadata already.

On possible approach is this:
https://blog.osgi.org/2013/02/javautilserviceloader-in-osgi.html

The other one is using fragments, which allows the API bundle to discover the 
"META-INF/services" files with its built in mechanism.

-Gunnar

_______________________________________________
equinox-dev mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/equinox-dev

Reply via email to