+

Search Tips   |   Advanced Search

Bundle and package versioning

Every bundle or export package has a version number in a specific format, and every import package statement has a version range. When we specify a version range, we need to consider current policy and best practices, and requirements for compatibility with both earlier and future versions.


Version numbers

Every bundle or export package has a version number. This version number consists of up to three numbers, in the following format:

9.9.9
The first number specifies the major component of the version number. The second number (if present) specifies the minor component of the version number, and the third number (if present) specifies the micro component of the version number. If we omit a component level, you also omit the period character, ., that comes before that component level. For example, the following three numbers all specify the same version:
9
9.0
9.0.0
According to the OSGi versioning policy, when a new version of a bundle or export package is not compatible with earlier versions you increment the major version number of the bundle or package.


Version ranges

Every import package statement specifies a version range. The OSGi Alliance recommends the following best practice for specifying a version range:

Version ranges are specified using the following notation:

For example, the following import statement can resolve against any version of a package from version 1.0 up to, but not including, version 2.0.

Import-Package: com.myco.a.pkge;version="[1.0,2.0)"

A package at version 1.3 is expected to be compatible with a package at version 1.0, and so a bundle that requires at least version 1.0 of a package should work if it is resolved against version 1.3 of that package. However, the bundle might not work if it is resolved against version 2.0 of the package, so version 2.0 and later versions are excluded.


Related:

  • Enterprise bundle archives
  • Composite bundles
  • Application bundles, use bundles and provision bundles
  • Web application bundles
  • EJB bundles
  • Update bundle versions for an EBA asset
  • Update bundle versions for an EBA asset using the editAsset command
  • Preview bundle versions update [Settings]
  • Update bundle versions in this application [Settings]




    File name: was326.html

    prettyPrint();