ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Dekany <>
Subject Re: [solved] How to prevent "unknown resolver" errors?
Date Wed, 11 Mar 2009 21:58:34 GMT
Wednesday, March 11, 2009, 7:22:42 PM, Daniel Dekany wrote:
> Wednesday, March 11, 2009, 5:26:04 PM, Brown, Carlton wrote:
>> It's documented, although the implications are not explained enough.
>> The subtle part is that Ivy actually uses 2 caches, a resolution cache
>> and a repository cache.
> But I guess I shouldn't use ${user.home}/.ivy2/cache as
> *repository* cache either. Certainly some other projects will use that
> too, and if they don't use lockStrategy="artifact-lock"... and I bet
> most will not. Well, it's rarely a problem, as two projects had to be
> built in parallel for that to be problem... but still, does it boil
> down to that most projects (or company) should use it's own caches
> (and not forgetting to set the *resolution* caches too)?

To answer my above question... I now tried using separate *resolution*
caches for each ivysetting.xml-s, but with the common per-user
*repository* cache, ${user.home}/.ivy2/cache. As the
ivysetting.xml-specific resolver names still get into
${user.home}/.ivy2/cache (yes, into the *repository* cache part of
it), it can still cause "undefined resolver" errors in *other*
projects that use ${user.home}/.ivy2/cache too. It doesn't cause
errors in my project though, as it knows the custom resolvers.

OK, so to recapitulate for the mail archives (experts please correct
where I'm mistaken):

First, note that there is *repository* cache VS *resolution* cache:

It seems to me, the only safe solution is using a separate
*repository* cache for each ivysettings.xml (at least), but it's
enough to associate that cache with the custom resolvers (not to the
built-in resolvers like "default", "local" and like; those you can
<include> in your ivysettings.xml), so the cache of the Ibiblio
artifacts can still remain global. Oh, and
lockStrategy="artifact-lock" should not be forgotten if the repository
cache will be accessed concurrently.

Also, if I get it right, you should use at least one *resolution*
cache per ivysettings.xml per user account, and that you better
associate to each resolvers, i.e. even to the built-in ones. Actually
I have to do it with even finer granularity: I use one resolution
cache per ivysettings.xml per user account per project, because two
projects that use the same ivysettings.xml may be built in parallel
(automated integration builds on the server).

Well... I hope people after me will Google for Ivy "unknown resolver"
with greater success.

>> -----Original Message-----
>> From: Daniel Dekany [] 
>> Sent: Wednesday, March 11, 2009 12:19 PM
>> To: Brown, Carlton
>> Cc:
>> Subject: Re: How to prevent "unknown resolver" errors?
>> Wednesday, March 11, 2009, 4:28:52 PM, Brown, Carlton wrote:
>>> Are you overriding the defaultCache attribute in your ivysettings 
>>> file, or are you just defining caches as attributes of resolvers?
>> Aha! I only set the last. I never realized that <caches
>> defaultCacheDir="..."> does what it does. It seems it solves the
>> problem, so thanks a lot! (I believe I read all the pages about the
>> concepts, but don't remember this things was addressed. If it isn't, it
>> should be.)
>>> -----Original Message-----
>>> From: Daniel Dekany []
>>> Sent: Monday, March 09, 2009 12:47 PM
>>> To:
>>> Subject: How to prevent "unknown resolver" errors?
>>> I declared own cache for all resolvers that I use, and that solved 
>>> this problem for a while. But if I resolve something that is also in 
>>> the default cache of Ivy (I mean ${user.home}/.ivy2/cache) the project
>>> pollutes or otherwise access it, and that will cause "unknown
>> resolver"
>>> errors again.
>>> For example, I store ant#ant in my own repo, called "myResolver", 
>>> which uses its own cache. Still, if the default cache of Ivy also 
>>> contains ant#ant (same revision), when I ivy:resolve in my project, 
>>> ${user.home}/.ivy2/cache/ant/ant/ivydata-[revision].properties is 
>>> modified so that it's last line will be resolver=myResolver. Thus, 
>>> when something else than my project uses the ${user.home}/.ivy2/cache 
>>> later to get ant#ant, I get a "unknown resolver myResolver" error. Why
>>> does my project touch the default cache at all when I set a 
>>> project-specific cache for all resolvers that it uses?
>>> --
>>> Best regards,
>>>  Daniel Dekany
>>> -----------------------------------------
>>> ====================================================
>>> This message contains PRIVILEGED and CONFIDENTIAL information that is 
>>> intended only for use by the named recipient. If you are not the named
>>> recipient, any disclosure, dissemination, or action based on the 
>>> contents of this message is prohibited. In such case please notify us 
>>> and destroy and delete all copies of this transmission.  Thank you.
>>> ====================================================
>> --
>> Best regards,
>>  Daniel Dekany

Best regards,
 Daniel Dekany

View raw message