Ivy
  1. Ivy
  2. IVY-681

Ivy uses the first set of configurations it sees when resolving multiple versions of a module

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-beta-1
    • Fix Version/s: 2.0-RC1
    • Component/s: Core
    • Labels:
      None

      Description

      When resolving two versions of a module, ivy uses the first configuration settings it sees.

      The following example demonstrates the issue:
      Dependencies:
      #foo;1.0->

      {#commons-beanutils;1.6 #bar;1.1}

      #bar;1.1->#commons-beanutils;1.7.0

      Configurations:
      #commons-beanutils;1.6 - 'default' configuration extends 'master' and 'runtime'. It publishes its artifact in the master config.
      #commons-beanutils;1.7 - only has 'default' configuration. It publishes its artifact in the default config.

      When ivy resolves the default configuration of #commons-beanutils;1.7.0, it tries to resolve the master and runtime configurations even though 1.7.0's default configuration doesn't extend master or runtime. 1.6's default configuration does extended master and runtime, so ivy isn't honoring the configuration settings for 1.7.0 when it evicts 1.6.

      Verbose output from ant:

      Apache Ant version 1.6.5 compiled on June 2 2005
      Buildfile: C:\workspace\test-repo\build.xml
      parsing buildfile C:\workspace\test-repo\build.xml with URI = file:///C:/workspace/test-repo/build.xml
      Project base dir set to: C:\workspace\test-repo
      Build sequence for target(s) `ivy-resolve' is [ivy-install, ivy-resolve]
      Complete build sequence is [ivy-install, ivy-resolve, ivy-clean, ]
      ivy-install:
      parsing buildfile jar:file:/C:/workspace/test-repo/ivy-2.0.0-beta1.jar!/org/apache/ivy/ant/antlib.xml with URI = jar:file:/C:/workspace/test-repo/ivy-2.0.0-beta1.jar!/org/apache/ivy/ant/antlib.xml
      ivy-resolve:
      Loading jar:file:/C:/workspace/test-repo/ivy-2.0.0-beta1.jar!/org/apache/ivy/core/settings/ivy.properties
      [ivy:resolve] :: Ivy 2.0.0-beta1 - 20071206070608 :: http://ant.apache.org/ivy/ ::
      :: loading settings :: file = C:\workspace\test-repo\ivysettings.xml
      no default ivy user dir defined: set to C:\Documents and Settings\hungerford_j\.ivy2
      no default cache defined: set to C:\Documents and Settings\hungerford_j\.ivy2\cache
      settings loaded (94ms)
      	default cache: C:\workspace\test-repo\cache
      	default resolver: local-test
      	-- 1 resolvers:
      	local-test [file]
      [ivy:resolve] using ivy parser to parse file:/C:/workspace/test-repo/ivy.xml
      [ivy:resolve] :: resolving dependencies :: acme#foo;1.0
      [ivy:resolve] 	confs: [default, master, runtime]
      [ivy:resolve] 	validate = true
      [ivy:resolve] resolving dependencies for configuration 'default'
      [ivy:resolve] == resolving dependencies for acme#foo;1.0 [default]
      [ivy:resolve] == resolving dependencies for acme#foo;1.0 [master]
      [ivy:resolve] == resolving dependencies for acme#foo;1.0 [runtime]
      [ivy:resolve] == resolving dependencies acme#foo;1.0->apache#commons-beanutils;1.6 [runtime->default]
      [ivy:resolve] 		tried C:\workspace\test-repo/apache/commons-beanutils/ivys/ivy-1.6.xml
      [ivy:resolve] 	local-test: found md file for apache#commons-beanutils;1.6
      [ivy:resolve] 		=> C:\workspace\test-repo\apache\commons-beanutils\ivys\ivy-1.6.xml (1.6)
      [ivy:resolve] downloading C:\workspace\test-repo\apache\commons-beanutils\ivys\ivy-1.6.xml ...
      [ivy:resolve] 	local-test: downloading C:\workspace\test-repo\apache\commons-beanutils\ivys\ivy-1.6.xml
      [ivy:resolve] 	[SUCCESSFUL ] apache#commons-beanutils;1.6!ivy.original.xml(ivy) (16ms)
      [ivy:resolve] 	found apache#commons-beanutils;1.6 in local-test
      [ivy:resolve] == resolving dependencies acme#foo;1.0->apache#commons-beanutils;1.6 [runtime->runtime]
      [ivy:resolve] == resolving dependencies acme#foo;1.0->apache#commons-beanutils;1.6 [runtime->master]
      [ivy:resolve] == resolving dependencies acme#foo;1.0->acme#bar;1.1 [runtime->default]
      [ivy:resolve] 		tried C:\workspace\test-repo/acme/bar/ivys/ivy-1.1.xml
      [ivy:resolve] 	local-test: found md file for acme#bar;1.1
      [ivy:resolve] 		=> C:\workspace\test-repo\acme\bar\ivys\ivy-1.1.xml (1.1)
      [ivy:resolve] downloading C:\workspace\test-repo\acme\bar\ivys\ivy-1.1.xml ...
      [ivy:resolve] 	local-test: downloading C:\workspace\test-repo\acme\bar\ivys\ivy-1.1.xml
      [ivy:resolve] 	[SUCCESSFUL ] acme#bar;1.1!ivy.original.xml(ivy) (16ms)
      [ivy:resolve] 	found acme#bar;1.1 in local-test
      [ivy:resolve] == resolving dependencies acme#foo;1.0->acme#bar;1.1 [runtime->master]
      [ivy:resolve] == resolving dependencies acme#foo;1.0->acme#bar;1.1 [runtime->runtime]
      [ivy:resolve] == resolving dependencies acme#bar;1.1->apache#commons-beanutils;1.7.0 [runtime->default]
      [ivy:resolve] 		tried C:\workspace\test-repo/apache/commons-beanutils/ivys/ivy-1.7.0.xml
      [ivy:resolve] 	local-test: found md file for apache#commons-beanutils;1.7.0
      [ivy:resolve] 		=> C:\workspace\test-repo\apache\commons-beanutils\ivys\ivy-1.7.0.xml (1.7.0)
      [ivy:resolve] downloading C:\workspace\test-repo\apache\commons-beanutils\ivys\ivy-1.7.0.xml ...
      [ivy:resolve] 	local-test: downloading C:\workspace\test-repo\apache\commons-beanutils\ivys\ivy-1.7.0.xml
      [ivy:resolve] 	[SUCCESSFUL ] apache#commons-beanutils;1.7.0!ivy.original.xml(ivy) (16ms)
      [ivy:resolve] 	found apache#commons-beanutils;1.7.0 in local-test
      [ivy:resolve] == resolving dependencies acme#bar;1.1->apache#commons-beanutils;1.7.0 [runtime->runtime]
      [ivy:resolve] == resolving dependencies acme#bar;1.1->apache#commons-beanutils;1.7.0 [runtime->master]
      [ivy:resolve] resolving dependencies for configuration 'master'
      [ivy:resolve] == resolving dependencies for acme#foo;1.0 [master]
      [ivy:resolve] resolving dependencies for configuration 'runtime'
      [ivy:resolve] == resolving dependencies for acme#foo;1.0 [runtime]
      [ivy:resolve] == resolving dependencies acme#foo;1.0->apache#commons-beanutils;1.6 [runtime->default]
      [ivy:resolve] == resolving dependencies acme#foo;1.0->apache#commons-beanutils;1.6 [runtime->runtime]
      [ivy:resolve] == resolving dependencies acme#foo;1.0->apache#commons-beanutils;1.6 [runtime->master]
      [ivy:resolve] == resolving dependencies acme#foo;1.0->acme#bar;1.1 [runtime->default]
      [ivy:resolve] == resolving dependencies acme#foo;1.0->acme#bar;1.1 [runtime->master]
      [ivy:resolve] == resolving dependencies acme#foo;1.0->acme#bar;1.1 [runtime->runtime]
      [ivy:resolve] == resolving dependencies acme#bar;1.1->apache#commons-beanutils;1.7.0 [runtime->default]
      [ivy:resolve] == resolving dependencies acme#bar;1.1->apache#commons-beanutils;1.7.0 [runtime->runtime]
      [ivy:resolve] == resolving dependencies acme#bar;1.1->apache#commons-beanutils;1.7.0 [runtime->master]
      [ivy:resolve] 	resolved ivy file produced in C:\workspace\test-repo\cache\resolved-acme-foo-1.0.xml
      [ivy:resolve] :: downloading artifacts ::
      [ivy:resolve] 		tried C:\workspace\test-repo/acme/bar/jars/bar-1.1.jar
      [ivy:resolve] downloading C:\workspace\test-repo\acme\bar\jars\bar-1.1.jar ...
      [ivy:resolve] 	local-test: downloading C:\workspace\test-repo\acme\bar\jars\bar-1.1.jar
      [ivy:resolve] . (0kB)
      [ivy:resolve] 	[SUCCESSFUL ] acme#bar;1.1!bar.jar (0ms)
      [ivy:resolve] :: resolution report :: resolve 531ms :: artifacts dl 16ms
      [ivy:resolve] 	:: evicted modules:
      [ivy:resolve] 	apache#commons-beanutils;1.6 by [apache#commons-beanutils;1.7.0] in [runtime, default]
      [ivy:resolve] 	  in acme#foo;1.0 with latest-revision
      [ivy:resolve] 	  in acme#foo;1.0 with latest-revision
      	---------------------------------------------------------------------
      	|                  |            modules            ||   artifacts   |
      	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
      	---------------------------------------------------------------------
      	|      default     |   3   |   3   |   0   |   1   ||   1   |   1   |
      	|      master      |   0   |   0   |   0   |   0   ||   0   |   0   |
      	|      runtime     |   3   |   3   |   0   |   1   ||   1   |   1   |
      	---------------------------------------------------------------------
      [ivy:resolve] WARN: 	::::::::::::::::::::::::::::::::::::::::::::::
      [ivy:resolve] WARN: 	::          UNRESOLVED DEPENDENCIES         ::
      [ivy:resolve] WARN: 	::::::::::::::::::::::::::::::::::::::::::::::
      [ivy:resolve] WARN: 	:: apache#commons-beanutils;1.7.0: configuration(s) not found in apache#commons-beanutils;1.7.0: master. It was required from acme#bar;1.1 runtime
      [ivy:resolve] WARN: 	::::::::::::::::::::::::::::::::::::::::::::::
      [ivy:resolve] 	report for acme#foo;1.0 default produced in C:\workspace\test-repo\cache\acme-foo-default.xml
      [ivy:resolve] 	report for acme#foo;1.0 master produced in C:\workspace\test-repo\cache\acme-foo-master.xml
      [ivy:resolve] 	report for acme#foo;1.0 runtime produced in C:\workspace\test-repo\cache\acme-foo-runtime.xml
      [ivy:resolve] 	resolve done (531ms resolve - 16ms download)
      [ivy:resolve] :: problems summary ::
      [ivy:resolve] :::: WARNINGS
      [ivy:resolve] 		::::::::::::::::::::::::::::::::::::::::::::::
      [ivy:resolve] 		::          UNRESOLVED DEPENDENCIES         ::
      [ivy:resolve] 		::::::::::::::::::::::::::::::::::::::::::::::
      [ivy:resolve] 		:: apache#commons-beanutils;1.7.0: configuration(s) not found in apache#commons-beanutils;1.7.0: master. It was required from acme#bar;1.1 runtime
      [ivy:resolve] 		::::::::::::::::::::::::::::::::::::::::::::::
      [ivy:resolve] 
      [ivy:resolve] 
      [ivy:resolve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
      
      BUILD FAILED
      
      1. ivy.zip
        5 kB
        Matt Reynolds

        Issue Links

          Activity

          Hide
          Matt Reynolds added a comment -

          Example of the problem

          Show
          Matt Reynolds added a comment - Example of the problem
          Hide
          Matt Reynolds added a comment -

          The workaround, from the ivy user list, is to edit existing published ivy files to add a fallback configuration.

          From Xavier:
          I suggested to use fallback configurations, which are documented here:
          http://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency.html
          (search for fallback)

          Show
          Matt Reynolds added a comment - The workaround, from the ivy user list, is to edit existing published ivy files to add a fallback configuration. From Xavier: I suggested to use fallback configurations, which are documented here: http://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency.html (search for fallback)
          Hide
          Xavier Hanin added a comment -

          I've added a unit test and fixed the problem: now Ivy still merges required configurations when evicting a module, but no longer halt the resolution if such a merged configuration is not available in the selected revision. This should fit your needs, please report any related problem with latest trunk version.

          Show
          Xavier Hanin added a comment - I've added a unit test and fixed the problem: now Ivy still merges required configurations when evicting a module, but no longer halt the resolution if such a merged configuration is not available in the selected revision. This should fit your needs, please report any related problem with latest trunk version.

            People

            • Assignee:
              Xavier Hanin
              Reporter:
              John Hungerford
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development