I am maintaining a web application that depends on OSGi and Maven pulls in a jar called org.osgi-foundation-1.0.0.jar that seems to contain the same classes as part of the JDK core runtime such as:
java.util.\*;
java.io.\*;
etc. and so on.
This seems very strange and I have to ask why this is necessary. More-over, my web-application fails to deploy on JBoss 6 because these are “illegal package names” for a third-party library.
What is the purpose of org.osgi-foundation-1.0.0.jar? Is it necessary?
org.osgi.foundationis a bundle containing all classes in the Foundation execution environment (see section 999 of the OSGi Compendium Specification).In short, an execution environment is the set of classes that are supposed to be available from the framework. They are grouped in profiles, such as
JavaMEorOSGi/Minimum. Bundles can express their use of a given execution environment in their manifest, and make sure they will only be started on a platform that e.g. provides AWT.The
org.osgi.foundationbundle you found represents one of these environments. It contains only stub classes, and is therefore only to be used during compilation.So, if Maven pulls in the bundle as a compile dependency, that’s fine, but it should never be deployed alongside your application.