Every bundle or export package has a version number in a specific format, and every import package statement has a version range. When you specify a version range, you need to consider current policy and best practices, and requirements for compatibility with both earlier and future versions.
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 you 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.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.
The Java™ Community Process (JCP) does not define OSGi metadata such as package versions when it defines APIs. Currently, the OSGi versions are defined in the OSGi specifications that reference the Java technologies. Future versions of JCP specifications are expected to be compatible with earlier versions, so the OSGi package versioning policy for such future specifications could simply reflect the JCP specification version. This might result in a change of major version of a javax package even when the new version is compatible with the old. For example, the Java Persistence API (JPA) 2.0 is compatible with the earlier version JPA 1.0. You might expect the javax.persistence package version to follow the JCP specification name and use version 2.0. However, it actually follows OSGi versioning policy and uses version 1.1.
Import-Package: javax.persistence;version="1.0"