Ivy
  1. Ivy
  2. IVY-970

<ivy:buildnumber> returns wrong result when resolve fails

    Details

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

      Description

      After publishing an artifact to the repository. Ivy uploads an ivy.xml and generates related .md5 .sha1 files.
      With a cleaned ivy cache the buildnumber task gives the wrong result when the ivy.xml in the repository is changed without changing the hash files.
      This is ok, as there is at least a warning. But currently there is nothing. The ivy:buildnumber task runs without a message and returns the "possibly" wrong next revision.

        Activity

        Hide
        Maarten Coene added a comment -

        could you give more info about what you did exactly and what ivy:buildnumber returns and what the correct result should be?

        Show
        Maarten Coene added a comment - could you give more info about what you did exactly and what ivy:buildnumber returns and what the correct result should be?
        Hide
        Michael Kebe added a comment -

        You can easily reproduce this with the examples coming with the release. Make sure to clear you Ivy cache and the repository directory of the multi-project example.

        I added an <echoproperties prefix="ivy.new" /> to the ivy-new-version target right after the <ivy:buildnumber> task in the common.xml from the multi-project example.

        michael@muhlap:~/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version$ ant publish
        Buildfile: build.xml
        
        clean-build:
           [delete] Deleting directory /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build
        
        load-ivy:
        
        ivy-new-version:
        No ivy:settings found for the default reference 'ivy.instance'.  A default instance will be used
        no settings file found, using default...
         [ivy:info] :: Ivy 2.0.0-rc2 - 20081028224207 :: http://ant.apache.org/ivy/ ::
        :: loading settings :: url = jar:file:/home/michael/.ant/lib/ivy-2.0.0-rc2.jar!/org/apache/ivy/core/settings/ivysettings.xml
        [echoproperties] #Ant properties
        [echoproperties] #Mon Nov 17 23:19:19 CET 2008
        [echoproperties] ivy.new.build.number=1
        [echoproperties] ivy.new.revision=1.0-dev-b1
        
        version:
            [mkdir] Created dir: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/classes
        
        clean-lib:
           [delete] Deleting directory /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/lib
        
        resolve:
            [mkdir] Created dir: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/lib
        [ivy:resolve] :: resolving dependencies :: org.apache.ivy.example#version;working@muhlap
        [ivy:resolve] 	confs: [default]
        [ivy:resolve] :: resolution report :: resolve 112ms :: artifacts dl 1ms
        	---------------------------------------------------------------------
        	|                  |            modules            ||   artifacts   |
        	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        	---------------------------------------------------------------------
        	|      default     |   0   |   0   |   0   |   0   ||   0   |   0   |
        	---------------------------------------------------------------------
        [ivy:retrieve] :: retrieving :: org.apache.ivy.example#version
        [ivy:retrieve] 	confs: [default]
        [ivy:retrieve] 	0 artifacts copied, 0 already retrieved (0kB/10ms)
        
        compile:
            [javac] Compiling 1 source file to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/classes
            [javac] Note: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/src/version/Version.java uses unchecked or unsafe operations.
            [javac] Note: Recompile with -Xlint:unchecked for details.
        
        jar:
              [jar] Building jar: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/version.jar
        
        publish:
        :: delivering :: org.apache.ivy.example#version;working@muhlap :: 1.0-dev-b1 :: release :: Mon Nov 17 23:19:21 CET 2008
        	delivering ivy file to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/ivy.xml
        :: publishing :: org.apache.ivy.example#version
        	published version to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b1.part/jars/version.jar
        	published ivy to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b1.part/ivys/ivy.xml
        	publish commited: moved /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b1.part 
        		to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b1
             [echo] project version released with version 1.0-dev-b1
        
        BUILD SUCCESSFUL
        Total time: 5 seconds
        

        This released the version-project to 1.0-dev-b1.

        michael@muhlap:~/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version$ ant publish
        Buildfile: build.xml
        
        clean-build:
           [delete] Deleting directory /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build
        
        load-ivy:
        
        ivy-new-version:
        No ivy:settings found for the default reference 'ivy.instance'.  A default instance will be used
        no settings file found, using default...
         [ivy:info] :: Ivy 2.0.0-rc2 - 20081028224207 :: http://ant.apache.org/ivy/ ::
        :: loading settings :: url = jar:file:/home/michael/.ant/lib/ivy-2.0.0-rc2.jar!/org/apache/ivy/core/settings/ivysettings.xml
        [echoproperties] #Ant properties
        [echoproperties] #Mon Nov 17 23:21:35 CET 2008
        [echoproperties] ivy.new.build.number=2
        [echoproperties] ivy.new.revision=1.0-dev-b2
        
        version:
            [mkdir] Created dir: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/classes
        
        clean-lib:
           [delete] Deleting directory /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/lib
        
        resolve:
            [mkdir] Created dir: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/lib
        [ivy:resolve] :: resolving dependencies :: org.apache.ivy.example#version;working@muhlap
        [ivy:resolve] 	confs: [default]
        [ivy:resolve] :: resolution report :: resolve 101ms :: artifacts dl 0ms
        	---------------------------------------------------------------------
        	|                  |            modules            ||   artifacts   |
        	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        	---------------------------------------------------------------------
        	|      default     |   0   |   0   |   0   |   0   ||   0   |   0   |
        	---------------------------------------------------------------------
        [ivy:retrieve] :: retrieving :: org.apache.ivy.example#version
        [ivy:retrieve] 	confs: [default]
        [ivy:retrieve] 	0 artifacts copied, 0 already retrieved (0kB/14ms)
        
        compile:
            [javac] Compiling 1 source file to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/classes
            [javac] Note: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/src/version/Version.java uses unchecked or unsafe operations.
            [javac] Note: Recompile with -Xlint:unchecked for details.
        
        jar:
              [jar] Building jar: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/version.jar
        
        publish:
        :: delivering :: org.apache.ivy.example#version;working@muhlap :: 1.0-dev-b2 :: release :: Mon Nov 17 23:21:36 CET 2008
        	delivering ivy file to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/ivy.xml
        :: publishing :: org.apache.ivy.example#version
        	published version to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b2.part/jars/version.jar
        	published ivy to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b2.part/ivys/ivy.xml
        	publish commited: moved /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b2.part 
        		to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b2
             [echo] project version released with version 1.0-dev-b2
        
        BUILD SUCCESSFUL
        Total time: 4 seconds
        

        This released the version-project to 1.0-dev-b2. ivy:buildnumber works fine.

        michael@muhlap:~/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version$ vi ../../repository/shared/org.apache.ivy.example/version/1.0-dev-b2/ivys/ivy.xml
        

        Change the ivy.xml somewhere (e.g. change the apache licence comment block), without updating the hash files.

        michael@muhlap:~/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version$ ant publish
        Buildfile: build.xml
        
        clean-build:
           [delete] Deleting directory /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build
        
        load-ivy:
        
        ivy-new-version:
        No ivy:settings found for the default reference 'ivy.instance'.  A default instance will be used
        no settings file found, using default...
         [ivy:info] :: Ivy 2.0.0-rc2 - 20081028224207 :: http://ant.apache.org/ivy/ ::
        :: loading settings :: url = jar:file:/home/michael/.ant/lib/ivy-2.0.0-rc2.jar!/org/apache/ivy/core/settings/ivysettings.xml
        [echoproperties] #Ant properties
        [echoproperties] #Mon Nov 17 23:23:09 CET 2008
        [echoproperties] ivy.new.build.number=1
        [echoproperties] ivy.new.revision=1.0-dev-b1
        
        version:
            [mkdir] Created dir: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/classes
        
        clean-lib:
           [delete] Deleting directory /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/lib
        
        resolve:
            [mkdir] Created dir: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/lib
        [ivy:resolve] :: resolving dependencies :: org.apache.ivy.example#version;working@muhlap
        [ivy:resolve] 	confs: [default]
        [ivy:resolve] :: resolution report :: resolve 114ms :: artifacts dl 1ms
        	---------------------------------------------------------------------
        	|                  |            modules            ||   artifacts   |
        	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        	---------------------------------------------------------------------
        	|      default     |   0   |   0   |   0   |   0   ||   0   |   0   |
        	---------------------------------------------------------------------
        [ivy:resolve] 
        [ivy:resolve] :: problems summary ::
        [ivy:resolve] :::: WARNINGS
        [ivy:resolve] 	problem while downloading module descriptor: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b2/ivys/ivy.xml: invalid sha1: expected=4c47592e428270f73b3bd08d8321d55f611ce3e5 computed=62f09b54f1e22e66763bf10e3551a9a35f91b883 (17ms)
        [ivy:resolve] 
        [ivy:resolve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
        [ivy:retrieve] :: retrieving :: org.apache.ivy.example#version
        [ivy:retrieve] 	confs: [default]
        [ivy:retrieve] 	0 artifacts copied, 0 already retrieved (0kB/2ms)
        
        compile:
            [javac] Compiling 1 source file to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/classes
            [javac] Note: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/src/version/Version.java uses unchecked or unsafe operations.
            [javac] Note: Recompile with -Xlint:unchecked for details.
        
        jar:
              [jar] Building jar: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/version.jar
        
        publish:
        :: delivering :: org.apache.ivy.example#version;working@muhlap :: 1.0-dev-b1 :: release :: Mon Nov 17 23:23:10 CET 2008
        	delivering ivy file to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/ivy.xml
        :: publishing :: org.apache.ivy.example#version
        
        BUILD FAILED
        /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/common/common.xml:161: impossible to publish artifacts for org.apache.ivy.example#version;working@muhlap: java.io.IOException: file copy not done from /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/version.jar to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b1/jars/version.jar: destination already exists and overwrite is false
        
        Total time: 4 seconds
        

        Now the build fails. The expected version should be 1.0-dev-b3, but as you can see from the <echoproperties> the property ivy.new.revision is set to "1.0-dev-b1". I think it should give an error or at least a warning when checking of a hash fails. As you can see the resolve task of the last "ant publish" give a warning, but the ivy:buildnumber task is just quiet.

        Show
        Michael Kebe added a comment - You can easily reproduce this with the examples coming with the release. Make sure to clear you Ivy cache and the repository directory of the multi-project example. I added an <echoproperties prefix="ivy.new" /> to the ivy-new-version target right after the <ivy:buildnumber> task in the common.xml from the multi-project example. michael@muhlap:~/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version$ ant publish Buildfile: build.xml clean-build: [delete] Deleting directory /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build load-ivy: ivy- new -version: No ivy:settings found for the default reference 'ivy.instance'. A default instance will be used no settings file found, using default ... [ivy:info] :: Ivy 2.0.0-rc2 - 20081028224207 :: http: //ant.apache.org/ivy/ :: :: loading settings :: url = jar:file:/home/michael/.ant/lib/ivy-2.0.0-rc2.jar!/org/apache/ivy/core/settings/ivysettings.xml [echoproperties] #Ant properties [echoproperties] #Mon Nov 17 23:19:19 CET 2008 [echoproperties] ivy. new .build.number=1 [echoproperties] ivy. new .revision=1.0-dev-b1 version: [mkdir] Created dir: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/classes clean-lib: [delete] Deleting directory /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/lib resolve: [mkdir] Created dir: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/lib [ivy:resolve] :: resolving dependencies :: org.apache.ivy.example#version;working@muhlap [ivy:resolve] confs: [ default ] [ivy:resolve] :: resolution report :: resolve 112ms :: artifacts dl 1ms --------------------------------------------------------------------- | | modules || artifacts | | conf | number| search|dwnlded|evicted|| number|dwnlded| --------------------------------------------------------------------- | default | 0 | 0 | 0 | 0 || 0 | 0 | --------------------------------------------------------------------- [ivy:retrieve] :: retrieving :: org.apache.ivy.example#version [ivy:retrieve] confs: [ default ] [ivy:retrieve] 0 artifacts copied, 0 already retrieved (0kB/10ms) compile: [javac] Compiling 1 source file to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/classes [javac] Note: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/src/version/Version.java uses unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. jar: [jar] Building jar: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/version.jar publish: :: delivering :: org.apache.ivy.example#version;working@muhlap :: 1.0-dev-b1 :: release :: Mon Nov 17 23:19:21 CET 2008 delivering ivy file to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/ivy.xml :: publishing :: org.apache.ivy.example#version published version to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b1.part/jars/version.jar published ivy to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b1.part/ivys/ivy.xml publish commited: moved /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b1.part to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b1 [echo] project version released with version 1.0-dev-b1 BUILD SUCCESSFUL Total time: 5 seconds This released the version-project to 1.0-dev-b1. michael@muhlap:~/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version$ ant publish Buildfile: build.xml clean-build: [delete] Deleting directory /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build load-ivy: ivy- new -version: No ivy:settings found for the default reference 'ivy.instance'. A default instance will be used no settings file found, using default ... [ivy:info] :: Ivy 2.0.0-rc2 - 20081028224207 :: http: //ant.apache.org/ivy/ :: :: loading settings :: url = jar:file:/home/michael/.ant/lib/ivy-2.0.0-rc2.jar!/org/apache/ivy/core/settings/ivysettings.xml [echoproperties] #Ant properties [echoproperties] #Mon Nov 17 23:21:35 CET 2008 [echoproperties] ivy. new .build.number=2 [echoproperties] ivy. new .revision=1.0-dev-b2 version: [mkdir] Created dir: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/classes clean-lib: [delete] Deleting directory /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/lib resolve: [mkdir] Created dir: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/lib [ivy:resolve] :: resolving dependencies :: org.apache.ivy.example#version;working@muhlap [ivy:resolve] confs: [ default ] [ivy:resolve] :: resolution report :: resolve 101ms :: artifacts dl 0ms --------------------------------------------------------------------- | | modules || artifacts | | conf | number| search|dwnlded|evicted|| number|dwnlded| --------------------------------------------------------------------- | default | 0 | 0 | 0 | 0 || 0 | 0 | --------------------------------------------------------------------- [ivy:retrieve] :: retrieving :: org.apache.ivy.example#version [ivy:retrieve] confs: [ default ] [ivy:retrieve] 0 artifacts copied, 0 already retrieved (0kB/14ms) compile: [javac] Compiling 1 source file to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/classes [javac] Note: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/src/version/Version.java uses unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. jar: [jar] Building jar: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/version.jar publish: :: delivering :: org.apache.ivy.example#version;working@muhlap :: 1.0-dev-b2 :: release :: Mon Nov 17 23:21:36 CET 2008 delivering ivy file to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/ivy.xml :: publishing :: org.apache.ivy.example#version published version to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b2.part/jars/version.jar published ivy to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b2.part/ivys/ivy.xml publish commited: moved /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b2.part to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b2 [echo] project version released with version 1.0-dev-b2 BUILD SUCCESSFUL Total time: 4 seconds This released the version-project to 1.0-dev-b2. ivy:buildnumber works fine. michael@muhlap:~/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version$ vi ../../repository/shared/org.apache.ivy.example/version/1.0-dev-b2/ivys/ivy.xml Change the ivy.xml somewhere (e.g. change the apache licence comment block), without updating the hash files. michael@muhlap:~/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version$ ant publish Buildfile: build.xml clean-build: [delete] Deleting directory /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build load-ivy: ivy- new -version: No ivy:settings found for the default reference 'ivy.instance'. A default instance will be used no settings file found, using default ... [ivy:info] :: Ivy 2.0.0-rc2 - 20081028224207 :: http: //ant.apache.org/ivy/ :: :: loading settings :: url = jar:file:/home/michael/.ant/lib/ivy-2.0.0-rc2.jar!/org/apache/ivy/core/settings/ivysettings.xml [echoproperties] #Ant properties [echoproperties] #Mon Nov 17 23:23:09 CET 2008 [echoproperties] ivy. new .build.number=1 [echoproperties] ivy. new .revision=1.0-dev-b1 version: [mkdir] Created dir: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/classes clean-lib: [delete] Deleting directory /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/lib resolve: [mkdir] Created dir: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/lib [ivy:resolve] :: resolving dependencies :: org.apache.ivy.example#version;working@muhlap [ivy:resolve] confs: [ default ] [ivy:resolve] :: resolution report :: resolve 114ms :: artifacts dl 1ms --------------------------------------------------------------------- | | modules || artifacts | | conf | number| search|dwnlded|evicted|| number|dwnlded| --------------------------------------------------------------------- | default | 0 | 0 | 0 | 0 || 0 | 0 | --------------------------------------------------------------------- [ivy:resolve] [ivy:resolve] :: problems summary :: [ivy:resolve] :::: WARNINGS [ivy:resolve] problem while downloading module descriptor: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b2/ivys/ivy.xml: invalid sha1: expected=4c47592e428270f73b3bd08d8321d55f611ce3e5 computed=62f09b54f1e22e66763bf10e3551a9a35f91b883 (17ms) [ivy:resolve] [ivy:resolve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS [ivy:retrieve] :: retrieving :: org.apache.ivy.example#version [ivy:retrieve] confs: [ default ] [ivy:retrieve] 0 artifacts copied, 0 already retrieved (0kB/2ms) compile: [javac] Compiling 1 source file to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/classes [javac] Note: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/src/version/Version.java uses unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. jar: [jar] Building jar: /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/version.jar publish: :: delivering :: org.apache.ivy.example#version;working@muhlap :: 1.0-dev-b1 :: release :: Mon Nov 17 23:23:10 CET 2008 delivering ivy file to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/ivy.xml :: publishing :: org.apache.ivy.example#version BUILD FAILED /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/common/common.xml:161: impossible to publish artifacts for org.apache.ivy.example#version;working@muhlap: java.io.IOException: file copy not done from /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/build/version.jar to /home/michael/java/apache-ivy-2.0.0-rc2/src/example/multi-project/projects/version/../../common/../repository/shared/org.apache.ivy.example/version/1.0-dev-b1/jars/version.jar: destination already exists and overwrite is false Total time: 4 seconds Now the build fails. The expected version should be 1.0-dev-b3, but as you can see from the <echoproperties> the property ivy.new.revision is set to "1.0-dev-b1". I think it should give an error or at least a warning when checking of a hash fails. As you can see the resolve task of the last "ant publish" give a warning, but the ivy:buildnumber task is just quiet.
        Hide
        Maarten Coene added a comment -

        I've added a junit test and committed a patch into SVN trunk.
        Could you give it a try?

        Show
        Maarten Coene added a comment - I've added a junit test and committed a patch into SVN trunk. Could you give it a try?
        Hide
        Michael Kebe added a comment -

        WIth the trunk now it is even worse.

        The second publish fails now. It tries to publish with version "1.0-dev-b1" although I expect "1.0-dev-b2". So I cannot run the testcase from above.

        publish:
        :: delivering :: org.apache.ivy.example#version;working@kebap :: 1.0-dev-b1 :: release :: Fri Nov 21 07:40:11 CET 2008
                delivering ivy file to D:\Temp\multi-project\projects\version\build\ivy.xml
        :: publishing :: org.apache.ivy.example#version
        
        BUILD FAILED
        D:\Temp\multi-project\common\common.xml:160: impossible to publish artifacts for org.apache.ivy.example#version;working@
        kebap: java.io.IOException: file copy not done from D:\Temp\multi-project\projects\version\build\version.jar to D:\Temp\
        multi-project\projects\version\..\..\common\..\repository\shared\org.apache.ivy.example\version\1.0-dev-b1\jars\version.
        jar: destination already exists and overwrite is false
        

        What I tried now:
        1. publish the version project with "ant publish"
        2. change the ivy.xml from the shared repository, so that the hashes are incorrect
        3. publish a second time

        Here the second publish also fails with the same message from above.

        What I expect:
        An error message like "The hash (md5, sha1) of the artifact (ivy.xml in this case) is no longer correct and could be manipulated by an evil guy". And the build should fail.

        Show
        Michael Kebe added a comment - WIth the trunk now it is even worse. The second publish fails now. It tries to publish with version "1.0-dev-b1" although I expect "1.0-dev-b2". So I cannot run the testcase from above. publish: :: delivering :: org.apache.ivy.example#version;working@kebap :: 1.0-dev-b1 :: release :: Fri Nov 21 07:40:11 CET 2008 delivering ivy file to D:\Temp\multi-project\projects\version\build\ivy.xml :: publishing :: org.apache.ivy.example#version BUILD FAILED D:\Temp\multi-project\common\common.xml:160: impossible to publish artifacts for org.apache.ivy.example#version;working@ kebap: java.io.IOException: file copy not done from D:\Temp\multi-project\projects\version\build\version.jar to D:\Temp\ multi-project\projects\version\..\..\common\..\repository\shared\org.apache.ivy.example\version\1.0-dev-b1\jars\version. jar: destination already exists and overwrite is false What I tried now: 1. publish the version project with "ant publish" 2. change the ivy.xml from the shared repository, so that the hashes are incorrect 3. publish a second time Here the second publish also fails with the same message from above. What I expect: An error message like "The hash (md5, sha1) of the artifact (ivy.xml in this case) is no longer correct and could be manipulated by an evil guy". And the build should fail.
        Hide
        Maarten Coene added a comment -

        I don't think the buildnumber task should check the correctness of existing ivy.xml files.
        So what I would expect is that after you change the ivy.xml on the repository, the buildnumber task still works as if nothing has been changed.

        But it's strange that you still get "1.0-dev-b1" as buildnumber after your first publish.
        I'll try to reproduce the problem...

        Show
        Maarten Coene added a comment - I don't think the buildnumber task should check the correctness of existing ivy.xml files. So what I would expect is that after you change the ivy.xml on the repository, the buildnumber task still works as if nothing has been changed. But it's strange that you still get "1.0-dev-b1" as buildnumber after your first publish. I'll try to reproduce the problem...
        Hide
        Michael Kebe added a comment -

        Reopening because issue is not completed yet.

        So what I would expect is that after you change the ivy.xml on the repository, the buildnumber task still works as if nothing has been changed.

        I don't agree.There could be an evil guy changing the revision information of the ivy.xml. This could bring the versioning/revisioning/buildnumbering into trouble.

        Show
        Michael Kebe added a comment - Reopening because issue is not completed yet. So what I would expect is that after you change the ivy.xml on the repository, the buildnumber task still works as if nothing has been changed. I don't agree.There could be an evil guy changing the revision information of the ivy.xml. This could bring the versioning/revisioning/buildnumbering into trouble.
        Hide
        Maarten Coene added a comment -

        I think I've found the problem and committed a fix into svn trunk.
        Could you please give it another try?

        Even if we check the validity of the ivy.xml in the repository, your evil guy can still mess up things when he:

        • also updates the checksum files after changing the ivy.xml file to make sure they are ok
        • or he could add completely new revisions by creating new directories and adding valid ivy.xml files in there

        I just don't think it's the responsability of the buildnumber task to check this, but we could probably add a flag to the buildnumber task indicating that the found revision must be checked for validity. If you really want something like this, could you add a new JIRA improvement request?

        Show
        Maarten Coene added a comment - I think I've found the problem and committed a fix into svn trunk. Could you please give it another try? Even if we check the validity of the ivy.xml in the repository, your evil guy can still mess up things when he: also updates the checksum files after changing the ivy.xml file to make sure they are ok or he could add completely new revisions by creating new directories and adding valid ivy.xml files in there I just don't think it's the responsability of the buildnumber task to check this, but we could probably add a flag to the buildnumber task indicating that the found revision must be checked for validity. If you really want something like this, could you add a new JIRA improvement request?
        Hide
        Michael Kebe added a comment -

        Okay, the publish after the changing the ivy.xml now works with the correct revision number.

        Anyway I think there should be at least a warning, about the wrong hash.

        Thanks for fixing this!

        Show
        Michael Kebe added a comment - Okay, the publish after the changing the ivy.xml now works with the correct revision number. Anyway I think there should be at least a warning, about the wrong hash. Thanks for fixing this!

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development