Maven 2.x Ant Tasks

unable to download a dependency when it is a SNAPSHOT and multiple remoteRepositories are used

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0.7
  • Fix Version/s: 2.0.8
  • Component/s: dependencies task, pom task
  • Labels:
    None
  • Testcase included:
    yes
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

Description

the conditions for this problem are very precise:<artifact:pom file="${user.dir}/src/test/pom-with-parent-SNAPSHOT.xml" id="my.maven.project.SNAPSHOT"> <localRepository path="target/tmp"/> <remoteRepository url="file://${user.dir}/src/test/repo"/> <remoteRepository url="file://${user.dir}/target/tmp/fake"/></artifact:pom>
but if the second remoteRepository is removed, or even the 2 repositories switched, there is no problem...

Issue Links

Activity

Hide
Herve Boutemy added a comment -

I made more tests: the problem is not related to the fact that it is a pom.
I have the exact same issue with dependencies task:

<artifact:dependencies>
  <dependency groupId="it.ant-tasks" artifactId="snapshotUniqueFalse" version="2.0.7-SNAPSHOT"/>
  <localRepository path="target/tmp"/>
  <remoteRepository url="file://${user.dir}/src/test/repo"/>
  <remoteRepository url="file://${user.dir}/target/tmp/fake"/>
</artifact:dependencies>
Show
Herve Boutemy added a comment - I made more tests: the problem is not related to the fact that it is a pom. I have the exact same issue with dependencies task:
<artifact:dependencies>
  <dependency groupId="it.ant-tasks" artifactId="snapshotUniqueFalse" version="2.0.7-SNAPSHOT"/>
  <localRepository path="target/tmp"/>
  <remoteRepository url="file://${user.dir}/src/test/repo"/>
  <remoteRepository url="file://${user.dir}/target/tmp/fake"/>
</artifact:dependencies>
Hide
Herve Boutemy added a comment -

Found and fixed the problem

When no id is specified on a repository declaration, a default id is used.
It was hardcoded as "remote" (even for local repo).
Then if there was 2 remoteRepository declarations, they had the same id even if they were for different urls...

With this patch, the default id for local repo is "local", and the url for a remote repo: we can't have the same id when 2 repos are different

Show
Herve Boutemy added a comment - Found and fixed the problem When no id is specified on a repository declaration, a default id is used. It was hardcoded as "remote" (even for local repo). Then if there was 2 remoteRepository declarations, they had the same id even if they were for different urls... With this patch, the default id for local repo is "local", and the url for a remote repo: we can't have the same id when 2 repos are different

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: