eclipse-pluginosgiosgi-bundleequinox

Why are some OSGi bundles in Eclipse extracted into directoris instead of being packaged as JARs?


I am trying to piece together some bundles for our internal testing. We are using Eclipse Equinox as OSGi implementation. I have hit a missing bundle (org.eclipse.jdt.debug). I was looking for it and found out it is not JAR but it is extracted into a directory instead.

Why is that? Is there any technical reason for some bundles in Eclipse being extracted and others being present as JARs?


Solution

  • Some plug-ins contain resources that need to be accessed by other code or by using normal Java file based APIs, so cannot be packed into a jar.

    The MANIFEST.MF of a plug-in can specify:

    Eclipse-BundleShape: dir
    

    to specify that the plugin be installed as a directory. If the plug-in is part of a feature this can also be specified in the unpack attribute in the feature.xml entry for the plug-in.

    I think the jdimodel.jar in the org.eclipse.jdt.debug needs to be accessed directly by a Java JVM so the plug-in is a directory.