ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keith Collison <>
Subject Help with custom conflict manager
Date Sun, 19 Nov 2006 21:19:12 GMT

Our support libraries are published with the following pattern (note 
these aren't ivy patterns): [module-name]-[version]_[buildnumber].  The 
version number is 2-3 digits -- therefore a typical publication may be 
"core-1.2_34", "core-1.2.1_1", etc.  In each case, the revision label 
registered with Ivy is "1.2_34", "1.2.1_1", and so forth.

The trouble I experienced was that Ivy would consider 1.2_34 to be later 
than 1.2.1_1.  Therefore, 1.2.1_1 would be evicted over 1.2_34.  I 
understood why this was -- Ivy treats the underscore characters as 
periods.  (I cursed the day I agreed to have module versions as "1.2" 
instead of "1.2.0".)

First of all, if you have a way to handle the above scenerio without 
defining a custom latest strategy, let me know.  As it was, I got 
started developing one to handle our version-label strategy.  I 
implemented LatestStrategy in my class.  It differs in one respect from 
the latest-revision strategy -- should it find the pattern (for example) 
1.2_34, it simply inserts the ".0" appropriately (so it ends up 
comparing 1.2.0_34).  My unit tests passed and I was pleased with myself.

The headaches began when I was trying to change our ivy configuration to 
use it.  I've got it registered OK, I've the <latest-strategies> and 
<conflict-managers> nodes defined.  I've a <module> tag, attached to our 
organization, which specifies the custom conflict manager to use.  
Appropriate resolvers have the "latest" attribute pointed to our custom 

Despite all of this, Ivy seems to use the default "latest-revision" 
conflict manager to determine which of our modules to evict.  Generating 
the ivy HTML report, nowhere is my conflict manager even referenced.   
The only way I can get my custom conflict manager to work is if I define 
the "defaultLatestStrategy" attribute on the <conf> tag.  It also works 
if I define the defaultConflictManager.  However,  I don't want to 
interfere with 3rd party conflict handling, so I'm hesitant to pursue 
that as a solution.

It just doesn't seem as if the conflict-manager for my <module> is being 

Am I missing something, or is this a bug in Ivy?   I've included our 
ivyconf below (I've changed some things for proprietary obfuscation, and 
removed property definitions for brevity).

Thanks for your help.

Kind regards,

Keith Collison

    <property name="" 
    <property name="ivy.default.resolver" value="default" override="false"/>

    <conf defaultCache="${ivy.default.ivy.user.dir}/cache" 
        <chain name="my-chain" latest="my-latest">
                <url name="web-staging">
                <url name="web-shared">

        <chain name="thirdparty-chain" returnFirst="true">
            <url name="web-thirdparty">
            <ivyrep name="ivyrep"/>
        <chain name="default">
            <resolver ref="thirdparty-chain"/>

    <typedef name="my-latest-strategy" classname="com.mylatest.MyLatest"/>
        <my-latest-strategy name="my-latest"/>

        <latest-cm name="my-revision" latest="my-latest"/>

        <module organisation="myorganization" matcher="regexp" 
conflict-manager="my-revision" name=".*" resolver="my-chain"/>

View raw message