Specifying version range

About this task

The version of the bundle or package is specified using OSGi syntax for a version range. The version range is specified using interval notation.
  • The open parentheses ( ) are used to denote that the value is not included in the range. The value is exclusive.
  • The closed parentheses [ ] are used to denote that the value is included in the range. The value is inclusive.

For example, the bundle with the version range version="[1.0.0,2.0.0)" includes version 1.0.0 but excludes version 2.0.0.

Specifying package and bundle version ranges in a bundle

Procedure

  1. Open the bundle manifest file in the editor.
  2. Switch to the Dependencies tab. In the Imported Packages section select the package for which you want to specify version information. Click Properties. In the dialog specify the minimum and maximum versions and if the values are inclusive or exclusive.
  3. Save the file.

Specifying bundle, composite, and fragment version ranges in an application

Procedure

  1. Open the application manifest file in the editor.
  2. In the Contained Bundles section, select the bundle for which you want to specify version information. Click Properties.
  3. In the OSGi bundle properties dialog specify the minimum and maximum versions and if the values are inclusive or exclusive.
  4. Save the file.

Specifying the bundle and fragment version in a composite bundle

Procedure

  1. Open the composite manifest file in the editor.
  2. In the Contained Bundles section, select the bundle for which you want to specify version information. Click Properties.
  3. In the OSGi bundle properties dialog specify the version. Bundles and fragments must have exact version numbers. If you require the same composite bundle with different versions of its content, you need to create different versions of the composite bundle, one version for each use.
  4. Save the file.

Specifying host bundle version ranges in a fragment bundle

Procedure

  1. Open the fragment bundle manifest file in the editor.
  2. Switch to the Overview tab. In the General Information section, specify the host bundle and minimum and maximum version information.
  3. Save the file.

Feedback