Generating the manifest

Finally, the manifest (/META-INF/MANIFEST.MF) for the OSGi bundle is generated from a mixture of information gathered from the bundle descriptor, the attributes specified through the Ant task and the decompiled Java class files.

Example 4.3. The resulting manifest file

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 1.5.0_22-b03 (Sun Microsystems Inc.)
Bundle-ManifestVersion: 2
Build-Id: 20101117114513 (Jeremias [Windows XP 5.1 x86, Java 1.5.0_22-
 b03])
Bundle-Activator: example.freespace.impl.Activator
Bundle-DocURL: http://www.jeremias-maerki.ch
Bundle-Name: Example :: Free Space Logging Example
Bundle-SymbolicName: example.freespace
Bundle-Vendor: Jeremias Märki, Switzerland
Bundle-Version: 1.0.0.dev
Implementation-Title: Free Space Example (example.freespace)
Implementation-URL: http://www.jeremias-maerki.ch
Implementation-Vendor: Jeremias Märki, Switzerland
Implementation-Version: 1.0.0.dev
Export-Package: example.freespace;version=1.0.0.dev
Import-Package: example.freespace;version=1.0.0.dev,org.apache.commons
 .io,org.osgi.framework

Looking at the manifest, you can see how the "Free Space" example has a dependency on Apache Commons IO and the OSGi core framework. Some header values have been set from Ant properties, others come from the bundle descriptor (like the Bundle-Activator).