Closed cescoffier closed 9 years ago
To fix this issue, I've proposed a BND plugin analyzing specified packages and adapting the version. It's made to avoid the generation of upper bound range when the artifacts is forward compatible.
The feature is activated by default and adapt the Guava imports to remove the upper bound. It is possible to add other packages to the list of fixed ranges by creating a src/main/osgi/versions.properties
file:
# Custom version file checking the three types of syntax
# version => no upper bound
org.joda.time=2.6.0
# range => as given
org.apache.felix.ipojo*=[1.12, 3)
# no value, range generated with lower bound found in classpath
org.mockito
When a range is set, the range is used. When just a version is set, if generate a range without upper bound. When nothing is set, it look for a provider in the classpath, extract the version and create a range with the found version as lower bound, and no upper bound.
Right now, when a project depends on a bundle that has a not standard versioning scheme, the generated import-package can be problematic.
For example, if your project depends on Guava 15, it generates a range [15, 16), and so does not let you use a recent version fo Guava.
I propose to analyse the version scheme and remove the upper bound of the range on these import. Obviously, this feature can be disabled, and a warning will be printed.