Discussion:
[tycho-user] Bug? mvn dependency:tree approximate of dependencies wrong
Andreas Sewe
2017-02-17 16:39:20 UTC
Permalink
Hi,

I my build, there are two versions of bundle com.google.guava: 15.0.0
and 21.0.0. Now, one of my plugins has
Import-Package: com.google.common.base;version="[15.0.0,16.0.0)"
in its MANIFEST.MF. During compilation, this works fine. It sees version
15.0.0 of com.google.guava (which exports the above package).

During a "mvn dependency:tree" however, Maven lists (only) Guava 21.0.0
[INFO] ------------------------------------------------------------------------
[INFO] Building org.eclipse.epp.logging.aeri.ide 2.0.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] org.eclipse.epp.logging:org.eclipse.epp.logging.aeri.ide:eclipse-plugin:2.0.3-SNAPSHOT
[INFO] +- p2.eclipse-plugin:com.google.guava:jar:21.0.0.v20170206-1425:system
Apparently, one of org.eclipse.epp.logging.aeri.ide's own dependencies
pulls in Guava 21.0.0 transitively.

The resulting discrepancy between the OSGi world and Tycho's
approximation of the rest of the world causes other plugins, like the
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java18:1.0
[ERROR] /tmp/org.eclipse.epp.logging/bundles/org.eclipse.epp.logging.aeri.ide/src/org/eclipse/epp/internal/logging/aeri/ide/utils/Zips.java:56: Undefined reference: Object com.google.common.io.OutputSupplier.getOutput()
[ERROR] /tmp/org.eclipse.epp.logging/git/org.eclipse.epp.logging/bundles/org.eclipse.epp.logging.aeri.ide/src/org/eclipse/epp/internal/logging/aeri/ide/server/json/Json.java:152: Undefined reference: Object com.google.common.io.InputSupplier.getInput()
Guava 15.0.0 contains OutputSupplier.getOutput() and
InputSupplier.getInput(), but apparently the animal-sniffer-maven-plugin
is looking at the wrong version, namely Guava 21.0.0.

Is this a bug with Tycho 1.0.0? I would think so, as being able to use
non-Tycho Maven plugins like animal-sniffer-maven-plugin seems like a
huge win (and so far has worked fine).

Best wishes,

Andreas
--
Codetrails GmbH
The knowledge transfer company

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

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940
Sievers, Jan
2017-02-20 08:39:30 UTC
Permalink
If I am not mistaken the dependencies injected into the maven model should be the ones resolved by the p2 resolver.
I would not expect a difference between dependency:tree and what the compiler sees.

Jan

On 17/02/2017, 17:39, "tycho-user-***@eclipse.org on behalf of Andreas Sewe" <tycho-user-***@eclipse.org on behalf of ***@codetrails.com> wrote:

Hi,

I my build, there are two versions of bundle com.google.guava: 15.0.0
and 21.0.0. Now, one of my plugins has
Import-Package: com.google.common.base;version="[15.0.0,16.0.0)"
in its MANIFEST.MF. During compilation, this works fine. It sees version
15.0.0 of com.google.guava (which exports the above package).

During a "mvn dependency:tree" however, Maven lists (only) Guava 21.0.0
[INFO] ------------------------------------------------------------------------
[INFO] Building org.eclipse.epp.logging.aeri.ide 2.0.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] org.eclipse.epp.logging:org.eclipse.epp.logging.aeri.ide:eclipse-plugin:2.0.3-SNAPSHOT
[INFO] +- p2.eclipse-plugin:com.google.guava:jar:21.0.0.v20170206-1425:system
Apparently, one of org.eclipse.epp.logging.aeri.ide's own dependencies
pulls in Guava 21.0.0 transitively.

The resulting discrepancy between the OSGi world and Tycho's
approximation of the rest of the world causes other plugins, like the
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java18:1.0
[ERROR] /tmp/org.eclipse.epp.logging/bundles/org.eclipse.epp.logging.aeri.ide/src/org/eclipse/epp/internal/logging/aeri/ide/utils/Zips.java:56: Undefined reference: Object com.google.common.io.OutputSupplier.getOutput()
[ERROR] /tmp/org.eclipse.epp.logging/git/org.eclipse.epp.logging/bundles/org.eclipse.epp.logging.aeri.ide/src/org/eclipse/epp/internal/logging/aeri/ide/server/json/Json.java:152: Undefined reference: Object com.google.common.io.InputSupplier.getInput()
Guava 15.0.0 contains OutputSupplier.getOutput() and
InputSupplier.getInput(), but apparently the animal-sniffer-maven-plugin
is looking at the wrong version, namely Guava 21.0.0.

Is this a bug with Tycho 1.0.0? I would think so, as being able to use
non-Tycho Maven plugins like animal-sniffer-maven-plugin seems like a
huge win (and so far has worked fine).

Best wishes,

Andreas
--
Codetrails GmbH
The knowledge transfer company

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

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940
Andreas Sewe
2017-02-24 14:47:34 UTC
Permalink
Post by Sievers, Jan
If I am not mistaken the dependencies injected into the maven model should be the ones resolved by the p2 resolver.
I would not expect a difference between dependency:tree and what the compiler sees.
I finally managed to open Bug 512697 [1] for this with some steps to
reproduce. Hope this helps.

Best wishes,

Andreas

[1] <https://bugs.eclipse.org/bugs/show_bug.cgi?id=512697>
--
Codetrails GmbH
The knowledge transfer company

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

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