ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xavier Hanin" <xavier.ha...@gmail.com>
Subject Re: Conflicting module configurations
Date Wed, 19 Dec 2007 17:56:16 GMT
On Dec 19, 2007 6:38 PM, John Hungerford <John.Hungerford@air2web.com>
wrote:

> On Dec 19, 2007 11:25 AM, Xavier Hanin <Xavier.hanin@gmail.com>
> wrote:
>
> > Ivy doesn't actually support depending on the same module twice, even
> > though we have never made this appear as an error. Having two versions
> of
> > a module requested through transitive dependencies is handled
> differently
> > in Ivy, so I'd recommend trying to reproduce the problem whilst still
> > using transitive dependencies. For instance #A;1.0->
> > {#B;1.0 #commons-beanutils;1.6} and #B;1.0->#commons-beanutils;1.7.
>
>
> Thanks for your quick response!  Originally, my project depended on the
> same module twice due to transitive dependencies, but ivy's behavior
> didn't change when I took out the middle module.  Here's the new setup
> I'm using:
> #foo;1.0->{#commons-beanutils;1.6 #bar;1.1}
> #bar;1.1->#commons-beanutils;1.7
>
> #commons-beanutils;1.6 has a default configuration, which extends master
> and runtime.  It publishes its artifact in the master config.
> #commons-beanutils;1.7 only has a default configuration.  It publishes
> its artifact in the default config.
>
>
> > This is a problem of conflict resolution, and really depend on how you
>
> > configure your conflict management, and the order of the dependencies.
> If
> > Ivy find 1.6 before 1.7, it will try to resolve the default conf
> (since
> > you ask for it when you say runtime with
> defaultconfmapping=*->default),
> > which in turn extends master and runtime conf in beanutils 1.6. Later
> it
> > will find 1.7, select it and evict 1.6 (if your conflict manager says
> so),
> > and merge information from the 1.6 revision to the 1.7. The
> information
> > merged is the callers (ie dependers) the required confs (in your case
> > default in both cases), the root module configuration in which the
> module
> > is needed, the dependency artifacts declared by dependers if any (none
> in
> > your case) and the current state of which configurations have been
> loaded.
> > So even though Ivy has loaded the runtime and master conf for 1.6, the
>
> > selection of 1.7 will just consider the dependencies of 1.7 in its
> default
> > conf.
>
>
> This is exactly how I expect ivy to behave.  The problem I'm
> experiencing is that when ivy considers the default configuration of
> 1.7, it also checks the master and runtime configurations even though
> 1.7's default configuration doesn't extend master or runtime.  1.6's
> default configuration did extended master and runtime, so I think ivy is
> hanging on to 1.6's configuration setup when it evicted 1.6.  Since
> 1.7's default configuration doesn't extend any other configurations, I
> think ivy should just consider the default configuration when it
> resolves the dependencies of 1.7.  Do you agree with this behavior, or
> am I missing something obvious?

I agree.



>
>
>
> > If Ivy finds 1.7 before 1.6 it will evict 1.6 before actually
> resolving
> > its dependencies, which will save the time of resolving 1.6
> dependencies,
> > but shouldn't alter the final result of dependencies.
>
> > So I don't know if this is actually what you encounter in your use
> case,
> > I'm not sure to get exactly what's going wrong for you. If you think
> Ivy
> > doesn't behave like I've explained, give some more details (including
> > verbose log), but before try to use transitive dependencies instead of
>
> > declaring the same dependency twice.
>
>
> Here's the verbose output from my buildfile.  Notice that ivy tries to
> resolve the master and runtime dependencies of #commons-beanutils;1.7.0
> even though it only has a default configuration:
>
> 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/cor
> e/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
> C:\workspace\test-repo\build.xml:21: impossible to resolve dependencies:
> *Standard failure stacktrace follows...*

Ok, it really sounds like a bug, it seems Ivy is confused with the
configurations extension. Could you open a JIRA issue with the same details
as provided here?

Xavier


>
>
>
> Thanks for your help,
> John
>



-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message