Ivy Settings - Changing the way conflicts are resolved

57 views Asked by At

We setup Ivy in such a way that all projects on trunk or a particular branch have the same version number for our foundation classes jars. For example, trunk is set, so all jars are 5.4, and all projects that use those jars request the 5.4 jars.

We branched off of trunk for a particular feature that will be introduced in release 5.5. Previously, we would simply set the revision on that branch as revision 5.5. We'd go to our Maven repository, and duplicate the 5.4 jars to version 5.5, so projects could build. Jars on this feature branch would be placed in the repo as 5.5 jars.

However, this caused problems. Imagine trunk is set as revision 5.3, and we anticipate that the feature would be complete in revision 5.5. We'd duplicate the 5.3 jars as 5.5 jars, and have developers work on the feature branch.

Now, let's say we place the trunk revision to 5.4. A particular jar is modified in version 5.4, but not necessarily on the feature branch. Now the jar on trunk has changes not found in the feature branch. Later, we move trunk to version 5.5 and merge changes on the branch back to trunk.

Now, a project uses that particular 5.5 jar which is really based upon revision 5.3. The changes in 5.4 aren't there.

To get around this, we're trying a new strategy where feature branches are given non-numeric revisions. This way, when we are ready to merge the branch back to trunk, we duplicate the latest version of the 5.4 jars for 5.5. Then, anything that gets merged back into trunk causes a rebuild.

The problem now is the conflict manager. We have version "fb-foo" on the branch, and "5.4" on trunk. If a particular jar, foo.jar is specified on the branch (revision fb-foo and another jar requested also asks for that particular jar, but version 5.4, we're pulling down the 5.4 version. We'd prefer to pull down the fb-foo version for projects on this branch.

I've tried changing our master ivysettings-public.xml file:

<ivysettings>
    <resolvers>
        <ibiblio name="public"
            m2compatible="true"
            checkmodified="true"
            root="http://buildl01.tcprod.local/artifactory/libs-release" />
    </resolvers>
    <latest-strategies>
        <latest-revision name="mylatest-revision" usedefaultspecialmeanings="false">
            <specialMeaning name="fb-foo"  value="99"/>
        </latest-revision>
    </latest-strategies>
</ivysettings>

However, according to the Ivy report, version 5.4 is still being preferred over version fb-foo.

Is there a way to change this? What if I used 5.4-foo as the version number?

0

There are 0 answers