Ivy
  1. Ivy
  2. IVY-1111

Ivy deliver fails to replace dynamic revision when using extra attributes

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0-RC2
    • Fix Version/s: 2.2.0-RC1
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Ivy 2.1.0-rc2 - 20090704004254
      Apache Ant version 1.7.0 compiled on December 13 2006

      Description

      Running ivy:deliver does not replace the dynamic revision correctly if I also use extended attributes.

      My Repository contains four modules: junit in revision 3.8 and 4.4. A Module A that depends on junit 4.4 and a module B that depends on junit "3.8.+". (I just copied this layout from a similar defect, IVY-999). (I will add a zip with this setup once I figure out how).

      My ivy.xml file:

      <?xml version="1.0" encoding="UTF-8"?>
      <ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
      <info organisation="test" module="c" e:att="att" />
      <!--adressmodul -->
      <configurations>
      <conf name="default" visibility="public"/>
      </configurations>
      <publications/>
      <dependencies>
      <dependency org="test" name="a" rev="latest.integration"/>
      <dependency org="junit" name="junit" conf="default" rev="latest.integration"/>
      <dependency org="test" name="b" rev="latest.integration" e:att="att"/>
      </dependencies>
      </ivy-module>

      The resultant ivy.xml after running the deliver task:
      <?xml version="1.0" encoding="UTF-8"?>
      <ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
      <info organisation="test" module="c" revision="20090819111124" status="integration" publication="20090819111124" e:att="att"/>
      <!--adressmodul -->
      <configurations>
      <conf name="default" visibility="public"/>
      </configurations>
      <publications/>
      <dependencies>
      <dependency org="test" name="a" rev="1" revConstraint="latest.integration"/>
      <dependency org="junit" name="junit" conf="default" rev="4.4" revConstraint="latest.integration"/>
      <dependency org="test" name="b" rev="latest.integration" e:att="att"/>
      </dependencies>
      </ivy-module>

      Update:
      A problem appears to be in the DeliverEngine.deliver(ModuleRevisionId, String, String, DeliverOptions) method, in step #3. Using SVN revision 811164, the line at 159 is:
      String rev = (String) resolvedRevisions.get(dependencies[i].getDependencyRevisionId());
      if (rev == null)

      { rev = dependencies[i].getDependencyRevisionId().getRevision(); }

      There are two ModuleRevisionId objects, one in the map and one in the DependencyDescriptor but they have different extra attributes. The one in the DependencyDescriptor includes the namespace on the extra attribute while the one in the map does not. Hence the lookup in the map is a miss so the failover action is to use the revision out of the DependencyDescriptor objects ModuleRevisionId, which is a dynamic revision.

      1. IVY-1111.svn.patch
        16 kB
        Michael Scheetz
      2. ivy-1111.zip
        4 kB
        Michael Scheetz

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          43d 4h 6m 1 Maarten Coene 01/Oct/09 22:35
          Maarten Coene made changes -
          Fix Version/s 2.2.0-RC1 [ 12315013 ]
          Fix Version/s trunk [ 12313426 ]
          Maarten Coene made changes -
          Link This issue is duplicated by IVY-1144 [ IVY-1144 ]
          Michael Scheetz made changes -
          Comment [ Maarten,

          Thanks for getting this one in. IVY-1128 also has a fix attached to it if you are looking for easy ones to commit.

          Michael


          ]
          Maarten Coene made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s trunk [ 12313426 ]
          Resolution Fixed [ 1 ]
          Hide
          Maarten Coene added a comment -

          I've applied your patch to SVN trunk.
          (I've made some little modifications to your unit test to make it compile with JDK 1.4)

          Thanks for the contribution!
          Maarten

          Show
          Maarten Coene added a comment - I've applied your patch to SVN trunk. (I've made some little modifications to your unit test to make it compile with JDK 1.4) Thanks for the contribution! Maarten
          Maarten Coene made changes -
          Original Estimate 48h [ 172800 ]
          Remaining Estimate 48h [ 172800 ]
          Assignee Maarten Coene [ maartenc ]
          Description Running ivy:deliver does not replace the dynamic revision correctly if I also use extended attributes.

          My Repository contains four modules: junit in revision 3.8 and 4.4. A Module A that depends on junit 4.4 and a module B that depends on junit "3.8.+". (I just copied this layout from a similar defect, IVY999). (I will add a zip with this setup once I figure out how).

          My ivy.xml file:

          <?xml version="1.0" encoding="UTF-8"?>
          <ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
              <info organisation="test" module="c" e:att="att" />
          <!--adressmodul -->
              <configurations>
                  <conf name="default" visibility="public"/>
              </configurations>
          <publications/>
              <dependencies>
                  <dependency org="test" name="a" rev="latest.integration"/>
                  <dependency org="junit" name="junit" conf="default" rev="latest.integration"/>
                  <dependency org="test" name="b" rev="latest.integration" e:att="att"/>
              </dependencies>
          </ivy-module>

          The resultant ivy.xml after running the deliver task:
          <?xml version="1.0" encoding="UTF-8"?>
          <ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
              <info organisation="test" module="c" revision="20090819111124" status="integration" publication="20090819111124" e:att="att"/>
          <!--adressmodul -->
              <configurations>
                  <conf name="default" visibility="public"/>
              </configurations>
          <publications/>
              <dependencies>
                  <dependency org="test" name="a" rev="1" revConstraint="latest.integration"/>
                  <dependency org="junit" name="junit" conf="default" rev="4.4" revConstraint="latest.integration"/>
                  <dependency org="test" name="b" rev="latest.integration" e:att="att"/>
              </dependencies>
          </ivy-module>


          Update:
          A problem appears to be in the DeliverEngine.deliver(ModuleRevisionId, String, String, DeliverOptions) method, in step #3. Using SVN revision 811164, the line at 159 is:
                String rev = (String) resolvedRevisions.get(dependencies[i].getDependencyRevisionId());
                      if (rev == null) {
                          rev = dependencies[i].getDependencyRevisionId().getRevision();
                      }

          There are two ModuleRevisionId objects, one in the map and one in the DependencyDescriptor but they have different extra attributes. The one in the DependencyDescriptor includes the namespace on the extra attribute while the one in the map does not. Hence the lookup in the map is a miss so the failover action is to use the revision out of the DependencyDescriptor objects ModuleRevisionId, which is a dynamic revision.
          Running ivy:deliver does not replace the dynamic revision correctly if I also use extended attributes.

          My Repository contains four modules: junit in revision 3.8 and 4.4. A Module A that depends on junit 4.4 and a module B that depends on junit "3.8.+". (I just copied this layout from a similar defect, IVY-999). (I will add a zip with this setup once I figure out how).

          My ivy.xml file:

          <?xml version="1.0" encoding="UTF-8"?>
          <ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
              <info organisation="test" module="c" e:att="att" />
          <!--adressmodul -->
              <configurations>
                  <conf name="default" visibility="public"/>
              </configurations>
          <publications/>
              <dependencies>
                  <dependency org="test" name="a" rev="latest.integration"/>
                  <dependency org="junit" name="junit" conf="default" rev="latest.integration"/>
                  <dependency org="test" name="b" rev="latest.integration" e:att="att"/>
              </dependencies>
          </ivy-module>

          The resultant ivy.xml after running the deliver task:
          <?xml version="1.0" encoding="UTF-8"?>
          <ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
              <info organisation="test" module="c" revision="20090819111124" status="integration" publication="20090819111124" e:att="att"/>
          <!--adressmodul -->
              <configurations>
                  <conf name="default" visibility="public"/>
              </configurations>
          <publications/>
              <dependencies>
                  <dependency org="test" name="a" rev="1" revConstraint="latest.integration"/>
                  <dependency org="junit" name="junit" conf="default" rev="4.4" revConstraint="latest.integration"/>
                  <dependency org="test" name="b" rev="latest.integration" e:att="att"/>
              </dependencies>
          </ivy-module>


          Update:
          A problem appears to be in the DeliverEngine.deliver(ModuleRevisionId, String, String, DeliverOptions) method, in step #3. Using SVN revision 811164, the line at 159 is:
                String rev = (String) resolvedRevisions.get(dependencies[i].getDependencyRevisionId());
                      if (rev == null) {
                          rev = dependencies[i].getDependencyRevisionId().getRevision();
                      }

          There are two ModuleRevisionId objects, one in the map and one in the DependencyDescriptor but they have different extra attributes. The one in the DependencyDescriptor includes the namespace on the extra attribute while the one in the map does not. Hence the lookup in the map is a miss so the failover action is to use the revision out of the DependencyDescriptor objects ModuleRevisionId, which is a dynamic revision.
          Michael Scheetz made changes -
          Attachment IVY-1111.svn.patch [ 12418539 ]
          Michael Scheetz made changes -
          Attachment IVY-1111.svn.patch [ 12418675 ]
          Hide
          Michael Scheetz added a comment -

          This patch contains a junit test and a fix.

          Show
          Michael Scheetz added a comment - This patch contains a junit test and a fix.
          Michael Scheetz made changes -
          Description Running ivy:deliver does not replace the dynamic revision correctly if I also use extended attributes.

          My Repository contains four modules: junit in revision 3.8 and 4.4. A Module A that depends on junit 4.4 and a module B that depends on junit "3.8.+". (I just copied this layout from a similar defect, IVY999). (I will add a zip with this setup once I figure out how).

          My ivy.xml file:

          <?xml version="1.0" encoding="UTF-8"?>
          <ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
              <info organisation="test" module="c" e:att="att" />
          <!--adressmodul -->
              <configurations>
                  <conf name="default" visibility="public"/>
              </configurations>
          <publications/>
              <dependencies>
                  <dependency org="test" name="a" rev="latest.integration"/>
                  <dependency org="junit" name="junit" conf="default" rev="latest.integration"/>
                  <dependency org="test" name="b" rev="latest.integration" e:att="att"/>
              </dependencies>
          </ivy-module>

          The resultant ivy.xml after running the deliver task:
          <?xml version="1.0" encoding="UTF-8"?>
          <ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
              <info organisation="test" module="c" revision="20090819111124" status="integration" publication="20090819111124" e:att="att"/>
          <!--adressmodul -->
              <configurations>
                  <conf name="default" visibility="public"/>
              </configurations>
          <publications/>
              <dependencies>
                  <dependency org="test" name="a" rev="1" revConstraint="latest.integration"/>
                  <dependency org="junit" name="junit" conf="default" rev="4.4" revConstraint="latest.integration"/>
                  <dependency org="test" name="b" rev="latest.integration" e:att="att"/>
              </dependencies>
          </ivy-module>
          Running ivy:deliver does not replace the dynamic revision correctly if I also use extended attributes.

          My Repository contains four modules: junit in revision 3.8 and 4.4. A Module A that depends on junit 4.4 and a module B that depends on junit "3.8.+". (I just copied this layout from a similar defect, IVY999). (I will add a zip with this setup once I figure out how).

          My ivy.xml file:

          <?xml version="1.0" encoding="UTF-8"?>
          <ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
              <info organisation="test" module="c" e:att="att" />
          <!--adressmodul -->
              <configurations>
                  <conf name="default" visibility="public"/>
              </configurations>
          <publications/>
              <dependencies>
                  <dependency org="test" name="a" rev="latest.integration"/>
                  <dependency org="junit" name="junit" conf="default" rev="latest.integration"/>
                  <dependency org="test" name="b" rev="latest.integration" e:att="att"/>
              </dependencies>
          </ivy-module>

          The resultant ivy.xml after running the deliver task:
          <?xml version="1.0" encoding="UTF-8"?>
          <ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
              <info organisation="test" module="c" revision="20090819111124" status="integration" publication="20090819111124" e:att="att"/>
          <!--adressmodul -->
              <configurations>
                  <conf name="default" visibility="public"/>
              </configurations>
          <publications/>
              <dependencies>
                  <dependency org="test" name="a" rev="1" revConstraint="latest.integration"/>
                  <dependency org="junit" name="junit" conf="default" rev="4.4" revConstraint="latest.integration"/>
                  <dependency org="test" name="b" rev="latest.integration" e:att="att"/>
              </dependencies>
          </ivy-module>


          Update:
          A problem appears to be in the DeliverEngine.deliver(ModuleRevisionId, String, String, DeliverOptions) method, in step #3. Using SVN revision 811164, the line at 159 is:
                String rev = (String) resolvedRevisions.get(dependencies[i].getDependencyRevisionId());
                      if (rev == null) {
                          rev = dependencies[i].getDependencyRevisionId().getRevision();
                      }

          There are two ModuleRevisionId objects, one in the map and one in the DependencyDescriptor but they have different extra attributes. The one in the DependencyDescriptor includes the namespace on the extra attribute while the one in the map does not. Hence the lookup in the map is a miss so the failover action is to use the revision out of the DependencyDescriptor objects ModuleRevisionId, which is a dynamic revision.
          Michael Scheetz made changes -
          Attachment IVY-1111.svn.patch [ 12418539 ]
          Michael Scheetz made changes -
          Summary Ivy deliver fails to replace dynamic revision with extended attribute Ivy deliver fails to replace dynamic revision when using extra attributes
          Michael Scheetz made changes -
          Field Original Value New Value
          Attachment ivy-1111.zip [ 12417044 ]
          Michael Scheetz created issue -

            People

            • Assignee:
              Maarten Coene
              Reporter:
              Michael Scheetz
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development