On Wed, Mar 5, 2008 at 3:35 PM, Jim Adams <[EMAIL PROTECTED]> wrote:

> Since the cache is global to all processes running on the machine I would
> think that it is very possible to get in the described situation. I could be
> downloading the same named module using 2 different resolvers and the
> modules could serve very different purposes. I may be forced into this for
> legacy reasons. I think the solution would be that the resolve engine take
> into account the resolver that was used to resolve the module and ignore any
> module resolved by a different resolver.

Mm, I see different cases, with different answers. In some cases you use the
same cache with different settings and even different repositories with
different metadata (this happens when you work on different projects, each
with its own settings, but using the default cache location). Then you'd
like Ivy to be able to isolate work from each dependency resolution, to
avoid strange collisions. The other use case is Hans' one, where you have
different settings but all of them lead to the same repositories, so you
want to really share the cache to improve performance.

I think Ivy should support both, with sensible defaults.


> Something else I have noticed is that if I resolve a module it finds the
> MD on one resolver then looks through all the resolvers again to find the
> artifacts. That has never seemed correct to me and is certainly inefficient.
> If that behavior is desired then I think is should be a fallback behavior.
> Look for the artifacts in the exact same location before scanning all the
> resolvers again.

Well, it doesn't really behave like this. It really depends on your
settings. If you don't put your resolvers in a dual resolver or a chain with
dual=true, you should have Ivy look for the artifact in the same resolver as
the one which found the metadata. If it doesn't work like this, it's a bug.

Xavier

>
>
>
> > -----Original Message-----
> > From: Xavier Hanin [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, March 05, 2008 8:08 AM
> > To: [email protected]
> > Subject: Re: Error message when using different settings
> >
> > On Wed, Mar 5, 2008 at 1:17 PM, Hans Dockter <[EMAIL PROTECTED]> wrote:
> >
> > > In my environment I use multiple settings to work with Ivy.
> > >
> > > One setting is the ivysettings.xml for building my build tool. The
> > > other setting is when I use my build tool which defines its own
> > > resolvers. If for example my build tool has been executed and has
> > > used Ivy to resolve a dependency that is also used by the build of my
> > > build tool, I get the following messages when building my build tool
> > > (chain is the name of  a resolver defined by my build tool).
> > >
> > > [ivy:cachepath] == resolving dependencies
> > > org.gradle#gradle;[EMAIL PROTECTED]>commons-lang#commons-lang;2.3
> > > [compile->default]
> > > [ivy:cachepath] loadData of commons-lang#commons-lang;2.3 of
> > > rootConf=compile
> > > [ivy:cachepath]         using default to resolve commons-lang#commons-
> > > lang;2.3
> > > [ivy:cachepath] default: Checking cache for: dependency: commons-
> > > lang#commons-lang;2.3 {compile=[default]}
> > > Resource org/apache/ivy/plugins/parser/xml/ivy.xsd loaded from ant
> > > loader
> > > [ivy:cachepath] pre 1.3 ivy file: using exactOrRegexp as default
> matcher
> > > [ivy:cachepath] ERROR: unknown resolver chain
> > > [ivy:cachepath]         resolver not found: chain => trying to use
> > > the one configured for commons-lang#commons-lang;2.3
> > > [ivy:cachepath]         configured resolver found for commons-
> > > lang#commons-lang;2.3: default: saving this data
> > > [ivy:cachepath] ERROR: unknown resolver chain
> > > [ivy:cachepath]         found ivy file in cache for commons-
> > > lang#commons-lang;2.3 (resolved by default): /Users/hans/.ivy2/cache/
> > > commons-lang/commons-lang/ivy-2.3.xml
> > > [ivy:cachepath] default: module revision found in cache: commons-
> > > lang#commons-lang;2.3
> > > [ivy:cachepath]         found commons-lang#commons-lang;2.3 in default
> > >
> > > Everything works but for me ERROR messages in the build log are very
> > > irritating if everything is OK.
> > >
> > > This problem has also been there with Ivy beta1 and is still there
> > > with Ivy beta2.
> >
> > The problem is that Ivy caches which resolver was used to resolve a
> > dependency, and when it reuses the cache, it tries to locate the
> resolver
> > previously used. This makes using the same cache with different settings
> > reporting errors like you see. I agree this is not very nice, but I
> haven't
> > found a pleasant solution yet. The easiest would be to have a parameter
> to
> > disable these messages, since it should work like this in most cases.
> But to
> > be clean we'd need to deeply review the usage of this information, to
> know
> > exactly what can be failing when the resolver information is not present
> or
> > missing in current settings.
> >
> > Please open an issue about that to be sure we don't forget to handle
> this
> > sooner or later.
> >
> > Xavier
> >
> >
> >
> >
> > >
> > >
> > > - Hans
> > >
> > >
> > >
> >
> >
> > --
> > Xavier Hanin - Independent Java Consultant
> > http://xhab.blogspot.com/
> > http://ant.apache.org/ivy/
> > http://www.xoocode.org/
>



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

Reply via email to