You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tim N <tn...@gmail.com> on 2020/02/27 01:27:33 UTC

Maven Artifact Resolver Ant Tasks - Transitive Dependency Versions

I've noticed Maven Artifact Resolver Ant Tasks resolves artifacts
differently to both pure maven and Maven Ant Tasks.

For example, in one project I'm looking at, both pure maven and Maven Ant
Tasks resolves a jar to be "activation-1.1.1.jar", but Maven Artifact
Resolver Ant Tasks resolves to "activation-1.1.jar". The dependency tree
gives the following:
mvn dependency:tree -Dverbose -Dincludes=javax.activation:activation
Using Maven 2 dependency tree to get verbose output, which may be
inconsistent with actual Maven 3 resolution
 company:core:jar:1.0.0-SNAPSHOT
 \- company:model:jar:1.0.0-SNAPSHOT:compile
    \- com.sun.mail:javax.mail:jar:1.5.6:compile
       \- javax.activation:activation:jar:1.1.1:compile (version managed
from 1.1)

I gather pure maven does the "version managed from 1.1" change that Maven
Artifact Resolver Ant Tasks isn't doing. Is there any way to get the same
behavior? Can you point me to the documentation on this behavior?

The same command above without "verbose":
mvn dependency:tree -Dincludes=javax.activation:activation
company:core:jar:1.0.0-SNAPSHOT
 \- company:model:jar:1.0.0-SNAPSHOT:compile
    \- com.sun.mail:javax.mail:jar:1.5.6:compile
       \- javax.activation:activation:jar:1.1.1:compile

The pure maven command I used to download the JARs is:
mvn -U dependency:copy-dependencies -DoutputDirectory=lib-compile
-DincludeScope=compile

In some cases, the JAR is a minor version out and the project won't compile.

Re: Maven Artifact Resolver Ant Tasks - Transitive Dependency Versions

Posted by Manfred Moser <ma...@simpligility.com>.
As long as you are comparing the maven artifact resolver task using same version as whatever Maven and dependency plugin you are using .. the results will be the same.

Resolution changed over time so older Maven versions and older Maven plugin have these difference.

Maven Ant Tasks is VERY old and uses an very old resolving mechanism .. so all bets are off.

Manfred

Tim N wrote on 2020-02-26 17:27 (GMT -08:00):

> I've noticed Maven Artifact Resolver Ant Tasks resolves artifacts
> differently to both pure maven and Maven Ant Tasks.
> 
> For example, in one project I'm looking at, both pure maven and Maven Ant
> Tasks resolves a jar to be "activation-1.1.1.jar", but Maven Artifact
> Resolver Ant Tasks resolves to "activation-1.1.jar". The dependency tree
> gives the following:
> mvn dependency:tree -Dverbose -Dincludes=javax.activation:activation
> Using Maven 2 dependency tree to get verbose output, which may be
> inconsistent with actual Maven 3 resolution
> company:core:jar:1.0.0-SNAPSHOT
> \- company:model:jar:1.0.0-SNAPSHOT:compile
>    \- com.sun.mail:javax.mail:jar:1.5.6:compile
>       \- javax.activation:activation:jar:1.1.1:compile (version managed
> from 1.1)
> 
> I gather pure maven does the "version managed from 1.1" change that Maven
> Artifact Resolver Ant Tasks isn't doing. Is there any way to get the same
> behavior? Can you point me to the documentation on this behavior?
> 
> The same command above without "verbose":
> mvn dependency:tree -Dincludes=javax.activation:activation
> company:core:jar:1.0.0-SNAPSHOT
> \- company:model:jar:1.0.0-SNAPSHOT:compile
>    \- com.sun.mail:javax.mail:jar:1.5.6:compile
>       \- javax.activation:activation:jar:1.1.1:compile
> 
> The pure maven command I used to download the JARs is:
> mvn -U dependency:copy-dependencies -DoutputDirectory=lib-compile
> -DincludeScope=compile
> 
> In some cases, the JAR is a minor version out and the project won't compile.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org