Maven 2.x Ant Tasks

[task dependencies]Trouble between mvn and manttasks

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 2.0.7
  • Fix Version/s: 2.0.9
  • Component/s: dependencies task
  • Labels:
    None
  • Environment:
    Windows 2000/XP
    Java version: 1.4.2_03
    Ant 1.6.5
  • Testcase included:
    yes
  • Number of attachments :
    1

Description

I have a library org.test.b.

  • In the first version i declare i have a dependency with the library org.test:d:1.1
  • In the second version i declare i have no dependencies

My current developpement use the library org.test.a which have a dependency with org.test:b:1.0.
I declare i prefered to use the new library org.test:b:1.1
and i have another library org.test:c because of its dependency, it must use the library org.test:d

If i write my pom like this :

<dependencies>
  <dependency>
    <groupId>org.test</groupId>
    <artifactId>a</artifactId>
    <version>1.0</version>
  </dependency>
  <dependency>
    <groupId>org.test</groupId>
    <artifactId>c</artifactId>
    <version>1.0</version>
  </dependency>
  <dependency>
    <groupId>org.test</groupId>
    <artifactId>b</artifactId>
    <version>1.1</version>
  </dependency>
</dependencies>

When I run ant with this pom :

<artifact:pom id="pom" file="pom.xml" />
<artifact:remoteRepository id="repository" url="file:./repository" />

<artifact:dependencies filesetId="compile.dependency.fileset" useScope="compile" verbose="true">
    <pom refid="pom" />
    <remoteRepository refid="repository" />
    <localRepository path="./localRepository" />
</artifact:dependencies>

the dependency fileset does not contain the library org.test:d

And when i run mvn site:site, i have org.test:d:1.2 in the scope compile.


here, you can find the dependency tree of my testcase

test:test-tree:jar:1.0 (selected)
  org.test:a:jar:1.0:compile (selected)
    org.test:b:jar:1.0:compile (selected)
      org.test:d:jar:1.1:compile (selected)
  org.test:c:jar:1.0:compile (selected)
    org.test:e:jar:1.0:compile (selected)
      org.test:d:jar:1.2:compile (removed - nearer found: 1.1)
  org.test:b:jar:1.0:compile (removed - nearer found: 1.1)
  org.test:b:jar:1.1:compile (selected)

To run my testcase you can do :

  • ant clean : to remove all generated
  • ant test : to check the problem

And you run maven (2.0.7) like this :

  • mvn -s settings.xml site:site

Issue Links

Activity

Hide
Herve Boutemy added a comment -

I reproduced the case, and yes it seems like a bug
for the moment, I could not fix it
I added it into svn, waiting for later resolution

Show
Herve Boutemy added a comment - I reproduced the case, and yes it seems like a bug for the moment, I could not fix it I added it into svn, waiting for later resolution
Hide
Herve Boutemy added a comment -

added ProfileManager use, which fixes resolution bug

Show
Herve Boutemy added a comment - added ProfileManager use, which fixes resolution bug
Hide
Herve Boutemy added a comment -

had to revert ProfileManager use since it breaks dependencies order when read pom.xml

Show
Herve Boutemy added a comment - had to revert ProfileManager use since it breaks dependencies order when read pom.xml
Hide
Herve Boutemy added a comment -

just re-tried the testcase in Maven Ant Tasks svn:

$ mvn -X -f pom-MANTTASKS-91.xml dependency:resolve

and found

[DEBUG] it.ant-tasks:MANTTASKS-91:jar:1.0 (selected for null)
[DEBUG]   org.test:a:jar:1.0:compile (selected for compile)
[DEBUG]     org.test:b:jar:1.0:compile (selected for compile)
[DEBUG]       org.test:d:jar:1.1:compile (selected for compile)
[DEBUG]   org.test:b:jar:1.0:compile (removed - nearer found: 1.1)
[DEBUG]   org.test:b:jar:1.1:compile (selected for compile)
[DEBUG]   org.test:c:jar:1.0:compile (selected for compile)
[DEBUG]     org.test:e:jar:1.0:compile (selected for compile)
[DEBUG]       org.test:d:jar:1.2:compile (selected for compile)

It seems that Maven resolves (a, b, c) dependencies in that order, instead of (a, c, b) like it is written in the pom.
To me, this is a bug in Maven... I need to investigate again

Show
Herve Boutemy added a comment - just re-tried the testcase in Maven Ant Tasks svn:
$ mvn -X -f pom-MANTTASKS-91.xml dependency:resolve
and found
[DEBUG] it.ant-tasks:MANTTASKS-91:jar:1.0 (selected for null)
[DEBUG]   org.test:a:jar:1.0:compile (selected for compile)
[DEBUG]     org.test:b:jar:1.0:compile (selected for compile)
[DEBUG]       org.test:d:jar:1.1:compile (selected for compile)
[DEBUG]   org.test:b:jar:1.0:compile (removed - nearer found: 1.1)
[DEBUG]   org.test:b:jar:1.1:compile (selected for compile)
[DEBUG]   org.test:c:jar:1.0:compile (selected for compile)
[DEBUG]     org.test:e:jar:1.0:compile (selected for compile)
[DEBUG]       org.test:d:jar:1.2:compile (selected for compile)
It seems that Maven resolves (a, b, c) dependencies in that order, instead of (a, c, b) like it is written in the pom. To me, this is a bug in Maven... I need to investigate again
Hide
Herve Boutemy added a comment -

bug in Maven confirmed (and fixed): see MNG-1412
Starting with 2.0.9, dependency resolution should be totally coherent between Maven Core and Maven Ant Tasks.

Thanks for your help with this report.

Show
Herve Boutemy added a comment - bug in Maven confirmed (and fixed): see MNG-1412 Starting with 2.0.9, dependency resolution should be totally coherent between Maven Core and Maven Ant Tasks. Thanks for your help with this report.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: