ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Trump" <>
Subject RE: Feature Request - Overridable resolvers
Date Fri, 12 Jun 2009 17:34:14 GMT
wouldn't it be better to include the public ivysettings in your project-specific ivysettings
file (instead of the other way around), and do the override logic that way?  the "override"
features requires that you know ahead of time what is going to be overridden in the parent
file.  This will tend to accumulate complexity in your master ivysettings file as your project


From: Peter Oxenham []
Sent: Tue 6/9/2009 10:16 PM
Subject: Feature Request - Overridable resolvers 

The ivy configuration I am currently have is where all projects include a global ivy settings
file, which is pretty much the same as the default ivy settings. (The whole setup is like
the multi-project example but using our own set of global ivy settings files)

Here is the dump of the resolvers

resolute [chain] [local, shared]
main [chain] [shared, public]
public [chain] [public-maven, spring]
spring [ibiblio]
local [file]
public-maven [ibiblio]
shared [file]
default [chain] [local, main]

The problem I am having is where a particular project needs some jars from another repository,
usually a maven2 repository. What I want to do is to override the public resolver to include
the new repository. What I initially tried was to create a project specific ivy settings file
and from it include the global settings file as well as defining the overriden public resolver.


<?xml version="1.0" encoding="UTF-8"?>
        <settings defaultResolver="default" />
        <include file="${}/ivysettings.xml" />
        <ibiblio name="jasig" m2compatible="true"
            root="" />

        <ibiblio name="jasig3rd-party" m2compatible="true"
            root="" />

                <chain name="public" returnFirst="true" >
                        <resolver ref="jasig"/>
                        <resolver ref="jasig3rd-party"/>
                        <ibiblio name="public-maven" m2compatible="true" />
                        <ibiblio name="spring" m2compatible="true" root=""/>


Unfortunately this didn't work. The original "public" resolver was still used by the "main"
resolver (see resolver dump above).

What I propose is to add an "override" attribute to all resolvers. When set to false, the
code in org.apache.ivy.core.settings.IvySettings.addResolver(DependencyResolver) will not
add it to the resolversMap if it already exists.

That way as long as my overriden "public" resolver is registered first, then when the "main"
resolver is defined it will get a reference to my "public" resolver instead of the one defined

What do you think?
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message