OSGi: programmatically add imports to a bundle
问题 How can I add packages to a bundle's import from within code? I need it since I use libraries which rely on reflection and require other packages and I don't want to need to manually add those packages to MANIFEST.MF for each bundle I develop 回答1: You cannot. Import-Packages are evaluated in the Resolution phase. (Phases are Installed -> Resolved -> Active ). Your code is executed when the bundle is Active, therefore too late to add Import-Packages. You can do 2 things: Import-Package the