Skip to main content

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

Andreas Sewe wrote:

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).

Does that mean even with the info I provided earlier on NTLM, things still don't work?

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.

I'm not exactly a hard-core OSGi guy so please bear with me. Let's assume Aether 0.9.1 is using "[0.9.1,1)" as range for its Import-Package statements. Let's further assume a new m2e version contains the same Aether JARs and re-exports them as 0.9.1. In this scenario, what prevents the error you just encountered? I.e. what logic/rules will ensure that the imported packages get consistently wired to the same bundle? I'm trying to understand why not everything is simply wired to 0.9.0.v20140226 in your current case and what actually needs to happen to reliably avoid that conflict going forward, especially when m2e picks up newer Aether versions.

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?)

The 0.9.0.v20140226 bundles/JARs are what they are and won't change. So it will be up to a 0.9.1 maitenance release to address this issue.

Aether's manifests are generated using the maven-bundle-plugin, I hope making the generated imports stricter is just a config option. With luck, I get stage 0.9.1 on the weekend. Still, I would like to gain a solid understanding why that conflict occurs in the first place. E.g. that error gets me wondering whether bundles of the same project should rather use Require-Bundle to find their relatives.


Benjamin



Back to the top