ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Oxenham <poxen...@resolute.com.au>
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.
 
i.e.
 
<?xml version="1.0" encoding="UTF-8"?>
<ivysettings>
	<settings defaultResolver="default" />
	<include file="${ivy.global.conf.dir}/ivysettings.xml" />
	<resolvers>
        <ibiblio name="jasig" m2compatible="true"
            root="http://developer.jasig.org/repo/content/repositories/m2" />

        <ibiblio name="jasig3rd-party" m2compatible="true"
            root="http://developer.jasig.org/repo/content/repositories/3rd-party" />

		<chain name="public" returnFirst="true" >
			<resolver ref="jasig"/>
			<resolver ref="jasig3rd-party"/>
			<ibiblio name="public-maven" m2compatible="true" />
			<ibiblio name="spring" m2compatible="true" root="http://s3.amazonaws.com/maven.springframework.org/milestone"/>
				 
			
		</chain>
	</resolvers>

</ivysettings>

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
globaly.


What do you think?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message