Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aether-users] Versioning fun with Aether milestones

Hi all,

I just had a lot of fun with Aether, milestones, and OSGi wiring.
Here's the story:

To work around some proxy authentication issues [1], I tried to upgrade
from org.eclipse.m2e.maven.runtime 1.4 (which includes Sonatype Aether)
to 1.5 (which includes Eclipse Aether 0.9.0.M2). Unfortunately, that
only made things (much) worse [2]; the HTTP library bundled with m2e
(OkHttp) has some serious issues with proxy authentication.

Thus, I decided to abandon our dependence on
org.eclipse.m2e.maven.runtime (which contains lots of stuff we don't
need anyway) and switch to the leaner Eclipse Aether 0.9.0.

And this worked great. :-)

Thanks to org.eclipse.aether.transport.http and the battle-hardened
Apache HttpComponents proxy authentication behaves as expected (except
for some NTLM glitches, but these were no worse than before).

Alas, the problems begin when I install both Code Recommenders and m2e
in the same Eclipse instance. As org.eclipse.m2e.maven.runtime exports
org.eclipse.aether.* packages with version 0.9.0.M2 (which is
incompatible with the final 0.9.0.v20140226) I am forced to use
Import-Package statements like the following (no pretty, but OK):

> org.eclipse.aether.artifact;version="[0.9.0.v20140226,1.0.0)"

But even that doesn't prevent the dreaded uses conflict from rearing its
ugly head:

> org.eclipse.recommenders.models [331]
>   Unresolved requirement: Require-Bundle: org.eclipse.recommenders.utils; bundle-version="2.0.0"
>     -> Bundle-SymbolicName: org.eclipse.recommenders.utils; bundle-version="2.1.0.v20140320-1514"
>        org.eclipse.recommenders.utils [333]
>          Bundle was not resolved because of a uses contraint violation.
>   org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.eclipse.recommenders.utils [osgi.identity; osgi.identity="org.eclipse.recommenders.utils"; type="osgi.bundle"; version:Version="2.1.0.v20140320-1514"] because it is exposed to package 'org.eclipse.aether.artifact' from resources org.eclipse.aether.api [osgi.identity; osgi.identity="org.eclipse.aether.api"; type="osgi.bundle"; version:Version="0.9.0.v20140226"] and org.eclipse.m2e.maven.runtime [osgi.identity; osgi.identity="org.eclipse.m2e.maven.runtime"; type="osgi.bundle"; version:Version="1.5.0.20140319-1741"; singleton:="false"] via two dependency chains.
> 
> Chain 1:
>   org.eclipse.recommenders.utils [osgi.identity; osgi.identity="org.eclipse.recommenders.utils"; type="osgi.bundle"; version:Version="2.1.0.v20140320-1514"]
>     import: (&(osgi.wiring.package=org.eclipse.aether.artifact)(&(version>=0.9.0.v20140226)(!(version>=1.0.0))))
>      |
>     export: osgi.wiring.package: org.eclipse.aether.artifact
>   org.eclipse.aether.api [osgi.identity; osgi.identity="org.eclipse.aether.api"; type="osgi.bundle"; version:Version="0.9.0.v20140226"]
> 
> Chain 2:
>   org.eclipse.recommenders.utils [osgi.identity; osgi.identity="org.eclipse.recommenders.utils"; type="osgi.bundle"; version:Version="2.1.0.v20140320-1514"]
>     import: (&(osgi.wiring.package=org.eclipse.aether.util.artifact)(&(version>=0.9.0.v20140226)(!(version>=1.0.0))))
>      |
>     export: osgi.wiring.package=org.eclipse.aether.util.artifact; uses:=org.eclipse.aether.artifact
>   org.eclipse.aether.util [osgi.identity; osgi.identity="org.eclipse.aether.util"; type="osgi.bundle"; version:Version="0.9.0.v20140226"]
>     import: (&(osgi.wiring.package=org.eclipse.aether.artifact)(&(version>=0.9.0)(!(version>=1.0.0))))
>      |
>     export: osgi.wiring.package: org.eclipse.aether.artifact
>   org.eclipse.m2e.maven.runtime [osgi.identity; osgi.identity="org.eclipse.m2e.maven.runtime"; type="osgi.bundle"; version:Version="1.5.0.20140319-1741"; singleton:="false"]  Bundle was not resolved because of a uses contraint violation.
>   org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.eclipse.recommenders.models [osgi.identity; osgi.identity="org.eclipse.recommenders.models"; type="osgi.bundle"; version:Version="2.1.0.v20140320-1514"; singleton:="true"] because it is exposed to package 'org.eclipse.aether.impl' from resources org.eclipse.aether.impl [osgi.identity; osgi.identity="org.eclipse.aether.impl"; type="osgi.bundle"; version:Version="0.9.0.v20140226"] and org.eclipse.m2e.maven.runtime [osgi.identity; osgi.identity="org.eclipse.m2e.maven.runtime"; type="osgi.bundle"; version:Version="1.5.0.20140319-1741"; singleton:="false"] via two dependency chains.

So, the problem for me is that Aether's API has changed between M2 and
the final 0.9.0 release, but I can't teach the org.eclipse.aether
bundles not to wire themselves to other org.eclipse.aether.* packages
from org.eclipse.m2e.maven.runtime. Their Import-Packages of

> org.eclipse.aether.artifact;version="[0.9,1)"

just aren't strict enough.

So, given that the 0.9.0.M2 milestone escaped into the wild (AFAIK,
0.9.0.M2 is what m2e will ship with Luna), is there a chance that
the0.9.0 Aether bundles will be republished with stricter Import-Package
ranges? (Alternatively, that there is a 0.9.1 in the near future?)

Best wishes and thanks for Aether (as I said, aside from the versioning
it works great),

Andreas

[1] <https://bugs.eclipse.org/bugs/show_bug.cgi?id=430716>
[2] <https://bugs.eclipse.org/bugs/show_bug.cgi?id=430772>

-- 
Codetrails UG (haftungsbeschränkt)
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940


Back to the top