OSGi plugin - MANIFEST.MF being overriden changed at runtime
-
13-07-2021 - |
Вопрос
Do you guys know if there is some way to change the MANISFEST.MF settings programmaticaly at time to load a plugin? It would be perfect for me if I could do that on Activator start method.
For example:
I have a plugin1 that have a dependency on its MANIFEST.MF to plugin2 (Require-Bundle: plugin2;bundle-version="1.0.0")> The change a wanna do is to set reexport such dependency before (visibility:=reexport) load plugin1.
Any suggestion
Thanks in advance
Raphael Moita
Решение
You cannot change the manifest. The manifest contains declarative information need to resolve the bundle and supply it a class loader with visibility to the necessary types. Your activator class is loaded by that class loader. How can you expect a class loaded the class loader to change the definition of the classes visible to the class loader?
Why don't you just modify the manifest before installing the bundle?