I think the behaviour is correct, but it might need some more 
documentation/improvement.
In fact, I think that the transitive=true on the resolve tasks means: "use the 
setting specified in the configuration", while transitive=false means: "don't 
resolve any dependencies transitively"

Maybe we could enhance this further to allow more values, like:

<ivy:resolve transitive="full" /> --> resolve all dependencies in a tranistive 
way, no matter what the configuration says
<ivy:resolve transitive="none" /> --> do not resolve the dependencies in a 
transitive way, no matter what the configuration says
<ivy:resolve:transitive="default" /> --> take the transitive attribute from the 
configuration (the default behaviour)

If this sound reasonable, please create a JIRA improvement request.

Maarten




----- Original Message ----
From: Hans Dockter <[email protected]>
To: [email protected]
Sent: Tuesday, January 27, 2009 12:45:26 PM
Subject: Re: Resolve behavior possibly broken in 2.0-final


On Jan 27, 2009, at 9:25 AM, Hans Dockter wrote:

> I might be missing something, but I think the resolve behavior in 2-0-final 
> has a bug.
> 
> I have the following ivy.xml and ant script:
> 
> <ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven";>
>    <info organisation="apache" module="hello-ivy"/>
>     <configurations>
>             <conf name="compile"  transitive="false"/>
>         </configurations>
>    <dependencies>
>        <dependency org="org.codehaus.groovy" name="groovy-all" rev="1.5.7" 
> conf="compile"/>
>    </dependencies>
> </ivy-module>
> 
> <project xmlns:ivy="antlib:org.apache.ivy.ant" name="hello-ivy" 
> default="resolve">
>    <target name="resolve" description="--> retrieve dependencies with ivy">
>        <ivy:resolve conf="compile" transitive="true"/>
>    </target>
> </project>
> 
> Although the transitive argument of the resolve task is true, the state of 
> the transitive property of the configuration wins. Groovy is not resolved 
> transitively. This is different to the behavior of ivy-2.0-rc1. I think the 
> resolve argument should always win.
> 
> If I do it vice versa the behavior is different:
> 
> <configurations>
>     <conf name="compile"  transitive="true"/>
> </configurations>
> 
> <ivy:resolve conf="compile" transitive="false"/>
> 
> Now the transitive argument of the resolve task wins. Groovy is not resolved 
> transitively.
> 
> Should I file a Jira?

I guess the problem, in particular if you use Ivy via its API, is that the 
ResolveOptions transitive property is a primitive boolean. So you can't 
indicate whether you really  want to override the setting of the configuration, 
or not.

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org


      

Reply via email to