views:

23

answers:

1

Background:

  • We are building an eclipse RCP plugin with Maven and generating the MANIFEST.MF file with the Apache Felix plugin. This plugin is part of a bigger RCP framework that is developed internally in our company.

The problem:

  • The Felix plugin sets Bundle-ManifestVersion=2 in the MANIFEST.MF file. When we use this manifest file, our framework throws different exceptions related to org.eclipse.runtime
  • When we set Bundle-ManifestVersion=1 (manually) or when we remove this entry from the MANIFEST.MF file, this error no longer appears.

The question:

  • What is the difference between Bundle-ManifestVersion=1 and Bundle-ManifestVersion=2?

The MANIFEST.MF file looks something like this:

Manifest-Version: 1.0
Embed-Directory: lib
Bundle-ClassPath: .
Tool: Bnd-0.0.357
Bundle-Name: [... omitted ...]
Created-By: Apache Maven Bundle Plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.core.runtime, [... omitted ...]
Build-Jdk: 1.6.0_21
Bundle-Version: 1.0.2
Bnd-LastModified: 1283847218240
Embed-Transitive: false
Bundle-ManifestVersion: 2
Import-Package: [... omitted ...]
Bundle-SymbolicName: [... omitted ...]`
A: 

According to OSGi core specifications r4 chapter 3.2.1.12 the Bundle-Manifest-Version header is:

The Bundle-ManifestVersion header defines that the bundle follows the rules of this specification. The Bundle-ManifestVersion header determines whether the bundle follows the rules of this specification. It is 1 (the default) for Release 3 Bundles, 2 for Release 4 and later. Future version of the OSGi Service Platform can define higher numbers for this header.

So I guess it depends on the equinox version you are using and thus the associated OSGI specification

Manuel Selva