You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by James Poli <Ja...@sas.com> on 2013/12/04 17:54:52 UTC

Programatically change the default cache manager

Hello,

I'm using Ivy 2.2.0 and trying to programmatically change the default cache manager and useOrigin value in a custom Ivy Ant task after the ivy settings file has been processed by Ivy configure task.  It doesn't appear to be using the new default cache with findrevision and resolve (i.e. in the resolvers)?   Is there extra processing I need to do with the resolvers already defined and processed by configure?

Thanks in advance,
Jim

<CODE SNIPPET>
    ...
    Ivy ivy = getIvyInstance();
    IvySettings settings = ivy.getSettings();
    DefaultRepositoryCacheManager cacheManager = new DefaultRepositoryCacheManager();
    cacheManager.setName("test-cache");
    settings.addRepositoryCacheManager(cacheManager);
    settings.setDefaultRepositoryCacheManager(cacheManager);
    settings.setDefaultUseOrigin(true);
    ...


<LOG OUTPUT>
    ...
    [ivy:findrevision] default-cache: cached resolved revision expired...
    ...
    [ivy:resolve] default-cache: cached resolved revision expired
    ...