Maven Ant Tasks
  1. Maven Ant Tasks
  2. MANTTASKS-78

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

    Details

    • Type: Bug Bug
    • Status: 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
    • Flags:
      Patch

      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...

      1. MANTTASKS-78.diff
        3 kB
        Hervé Boutemy

        Issue Links

          Activity

          Hervé Boutemy created issue -
          Hervé Boutemy made changes -
          Field Original Value New Value
          Attachment MANTTASKS-78.diff [ 28375 ]
          Hide
          Hervé 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
          Hervé 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>
          Hervé Boutemy made changes -
          Component/s dependencies task [ 12843 ]
          Summary unable to download parent pom when it is a SNAPSHOT and multiple remoteRepositories are used unable to download a dependency when it is a SNAPSHOT and multiple remoteRepositories are used
          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...
          the conditions for this problem are very precise:
          {code:xml}
          <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>
          {code}

          but if the second remoteRepository is removed, or even the 2 repositories switched, there is no problem...
          Hide
          Hervé 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
          Hervé 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
          Hervé Boutemy made changes -
          Attachment MANTTASKS-78.diff [ 28685 ]
          Hervé Boutemy made changes -
          Attachment MANTTASKS-78.diff [ 28375 ]
          Hervé Boutemy made changes -
          Fix Version/s 2.0.8 [ 13618 ]
          Patch Submitted [Yes]
          Hervé Boutemy made changes -
          Description the conditions for this problem are very precise:
          {code:xml}
          <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>
          {code}

          but if the second remoteRepository is removed, or even the 2 repositories switched, there is no problem...
          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...
          Original Estimate 0h [ 0 ]
          Remaining Estimate 0h [ 0 ]
          Assignee Herve Boutemy [ hboutemy ]
          Hervé Boutemy made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          Benjamin Bentmann made changes -
          Link This issue relates to MANTTASKS-142 [ MANTTASKS-142 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 09:00:58 UTC 2015 [ 1428224458201 ]
          Mark Thomas made changes -
          Workflow jira [ 12716171 ] Default workflow, editable Closed status [ 12760054 ]
          Mark Thomas made changes -
          Patch Submitted Yes [ 10763 ]
          Flags Patch [ 10430 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 22:08:22 UTC 2015 [ 1428271702400 ]
          Mark Thomas made changes -
          Workflow jira [ 12953468 ] Default workflow, editable Closed status [ 12990555 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          99d 2h 9m 1 Hervé Boutemy 19/Oct/07 17:04

            People

            • Assignee:
              Hervé Boutemy
              Reporter:
              Hervé Boutemy
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development