Import-Package version matching [message #913121] |
Fri, 14 September 2012 20:20 |
|
Please consider the following of bundle version resolving issue. Some
plug-in, e.g. com.acme.exports, exports package in MANIFEST.MF like this:
Bundle-SymbolicName: com.acme.exports
...
Export-Package: com.acme.foo,
com.acme.bar,
...
Some other plug-in, e.g. com.acme.imports, imports (consumes)
com.acme.exports's exported packages like:
Bundle-SymbolicName: com.acme.imports
...
Import-Package: com.acome.foo,
com.acme.bar;version="1.3.0",
...
In the example above, com.acme.bar package will not be resolved since it
explicitly requires 1.3.0 version of com.acme.bar but this package
doesn't declare any version.
Is this behavior in accordance with OSGi specification? I'm unsure about
it and I intuitively expected that if there is no exact version match,
the unspecified (and the only) version will be used instead.
Thanks for clarification
Libor
|
|
|
|
Re: Import-Package version matching [message #913311 is a reply to message #913134] |
Sat, 15 September 2012 08:05 |
|
Thanks for quick and clear reply Thomas!
Libor
On 09/14/2012 10:52 PM, Thomas Watson wrote:
> Quote:
>> Is this behavior in accordance with OSGi specification? I'm unsure
>> about it and I intuitively expected that if there is no exact version
>> match, the unspecified (and the only) version will be used instead.
>
>
> This is in accordance with the OSGi spec. If an import specifies a
> version then it is saying that the exporter of the package must provide
> a version that matches the ranges specified on the import.
>
>
> Quote:
>> Import-Package: com.acome.foo,
>> com.acme.bar;version="1.3.0",
>
>
> Here the bundle is stating that it can only get wired to a package
> com.acme.bar if and only if that package provides a version >= 1.3.0.
>
> Quote:
>> Export-Package: com.acme.foo,
>> com.acme.bar,
>
>
> These exported packages specify no version so they get a default version
> of 0.0.0. Since 0.0.0 is not >= 1.3.0 the exported package org.acme.bar
> cannot be used to resolve the import com.acme.bar;version="1.3.0"
>
> Tom
|
|
|
Powered by
FUDForum. Page generated in 0.04084 seconds