Java Reference
In-Depth Information
Bundle X
v 3.7
Bundle X
v 4.1
Bundle B
v 1.0.0
Bundle C
v 2.0.0
Bundle A
v 1.0.0
Figure A.1 The transitive dependencies of a module (the dependencies of its dependencies) may have
incompatible versions. OSGi allows the implementations to coexist by isolating them from one another.
Why everything has a version
Every exported package and bundle in OSG i has a version. Even if you don't specify an
explicit version, you still have an implicit version of 0.0.0. This version may or may not
be what you want. For example, let's assume you release a package without specifying
a version (your version is 0.0.0):
Export-Package: food.experimental
Other bundles can import the package in several ways. If no version is specified as fol-
lows, any available version of the package will be imported:
Import-Package: food.experimental
This is equivalent to the following:
Import-Package: food.experimental;version="0.0.0"
always ranges. If only one version is specified on a package import, it's a mini-
mum version, not an exact version. This isn't totally intuitive, so it's easy to for-
get, even for developers who've been using OSG i for years. To specify a
Search WWH ::

Custom Search