Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] Eclipse Code Recommenders and m2e 1.5

Hi Martin, hi Igor,

> regarding the issue with the runtime bundle exporting foreign packages
> (like javax.inject etc.), I filed an issue a while ago:
> 
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=411944
> 
> In case you want to refer to that.

digging into the OSGi spec I think I have a workaround (I wouldn't call
it a solution, though ;-):

Citing from the commit message (the change is currently in Gerrit [1]):
> This uses a pretty weird OSGi hack: any bundle that uses
> Require-Bundle: org.eclipse.m2e.maven.runtime *has* to
> Import-Package: javax.inject, even if it doesn't need it
> otherwise (in that case, the import can be optional). This
> ensures that the OSGi runtime does *not* wire any o.e.r
> bundle to the javax.inject unfortunately exported by
> the Maven runtime bundle. (See Section 3.13.3 of the OSGi 5
> Core Spec: imports are searched before required bundles.)

So far this commit seems to play nicely with the latest m2e milestone;
the 1.4 and 1.5 runtime are wired correctly. It even works for those
o.e.recommenders bundles importing Gauav 14. They now get their
com.google.commons.* 14.0 from o.e.m2e.maven.runtime 1.5 and their
org.sonatype.aether.* from o.e.m2e.maven.runtime 1.4. Sometimes OSGi
works just as advertised. :-)

So, I think I'll leave it at that for now and experiment with a port to
org.eclipse.aether in the near future (after M3!).

Best wishes,

Andreas

[1] <https://git.eclipse.org/r/#/c/18294/1>

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