Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.0.4
-
None
-
None
-
Windows XP, Java 1.5.0_08-b03, Ant 1.6.5, Maven 2.0.4
Description
This issue may be related to MNG-2543.
The ant <dependencies> task resolves transitive SNAPSHOT dependencies incorrectly. Here's an example:
[dependencies section of pom.xml for project A]
...
<dependencies>
<dependency>
<groupId>hapi</groupId>
<artifactId>hapi</artifactId>
<version>0.5beta-SNAPSHOT</version>
</dependency>
</dependencies>
...
[dependencies section of pom.xml for project B]
...
<dependencies>
<dependency>
<groupId>my-company</groupId>
<artifactId>project-A</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
...
When I use the <dependencies> task to build a classpath for project A everything is OK:
<mvn:dependencies pathId="compile.classpath" useScope="compile">
<pom refid="maven.pom" />
</mvn:dependencies>
- gives -
\.m2\repository\hapi\hapi\0.5beta-SNAPSHOT\hapi-0.5beta-SNAPSHOT.jar
But when I use the same task to build a classpath for project B, the version numbering goes bad:
<mvn:dependencies pathId="compile.classpath" useScope="compile">
<pom refid="maven.pom" />
</mvn:dependencies>
- gives -
\.m2\repository\hapi\hapi\0.5beta-20060814.110000-1\hapi-0.5beta-20060814.110000-1.jar
The files in my repository are:
\.m2\repository\hapi\hapi\0.5beta-SNAPSHOT\hapi-0.5beta-20060814.110000-1.jar
\.m2\repository\hapi\hapi\0.5beta-SNAPSHOT\hapi-0.5beta-SNAPSHOT.jar
For some reason, the <dependencies> task uses the expanded artifact name for the folder as well, but the folder name should use SNAPSHOT. If I use the mvn executable itself to run a compile instead of the ant tasks, then there is no problem and the jar is correctly resolved. It seems that the ant tasks have a different mechanism of resolving transitive dependencies than the mvn executable.
Attachments
Issue Links
- duplicates
-
MANTTASKS-18 filesetId does not contain all dependencies when artifact was not yet locally installed
- Closed
- is related to
-
MANTTASKS-18 filesetId does not contain all dependencies when artifact was not yet locally installed
- Closed
- relates to
-
MANTTASKS-7 dependencies ant task does not handle scoped transitive dependencies correctly
- Closed