ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Oxenham <>
Subject Feature Request - Overridable resolvers
Date Wed, 10 Jun 2009 05:16:46 GMT
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