Description

In the artifact:dependencies task the filesetId is only correctly set, when the artifact was installed locally before running ant.

After deletion of the local repository the dependant artifacts will be downloaded to the local repository, but only one of two dependant files will be included in the ant fileset. The classpath is set correctly.

I have encountered this problem too, but have more to share on it. The failure to properly use the SNAPSHOT part of the path to the file seems to be related to when there is a definition of a <remoteRepository> in the ant build file.

Peter Murray
added a comment - 11/Jan/07 11:27 AM I have encountered this problem too, but have more to share on it. The failure to properly use the SNAPSHOT part of the path to the file seems to be related to when there is a definition of a <remoteRepository> in the ant build file.
<artifact:dependencies pathId="maven.dependencies" filesetId="dependency.fileset">
<dependency groupId="com.tracegroup" artifactId="gui-tabs-and-docking" version="1.0-SNAPSHOT"/>
<localRepository location="$
{basedir}
/dependencies"/>
<remoteRepository refid="remote.repository"/>
</artifact:dependencies>
If the <remoteRepository> part was commented out (after the files were downloaded to the local repository) the paths would use SNAPSHOT as expected instead of the timestamp.

Here is a new patch against latest revision in svn. It contains unit tests to check SNAPSHOT handling, one with uniqueVersion="false", one with uniqueVersion="true".
The workaround in DependenciesTask is for uniqueVersion="true", which fails without it.
It's only a workaround, since the resolved artifact should have baseVersion containing "-SNAPSHOT" and not "-timestamp": this issue needs more work to really be fixed.

Herve Boutemy
added a comment - 10/Jun/07 3:35 PM Here is a new patch against latest revision in svn. It contains unit tests to check SNAPSHOT handling, one with uniqueVersion="false", one with uniqueVersion="true".
The workaround in DependenciesTask is for uniqueVersion="true", which fails without it.
It's only a workaround, since the resolved artifact should have baseVersion containing "-SNAPSHOT" and not "-timestamp": this issue needs more work to really be fixed.

Herve Boutemy
added a comment - 12/Jun/07 4:27 PM Yeah!
looking for a real fix, I just found MNG-2961 DefaultArtifact getBaseVersion is changed to "xxxx-SNAPSHOT" only if you first call isSnapshot()
That's it!!!
Here is a new patch with this little workaround: simply call artifact.isSnapshot() before calculating filename.
Unit test show that it works: cool.
Now, the real bug is in MNG-2961 , and the workaround in Maven Ant Tasks is really simple.