On 04/11/2010, at 11:03 AM, Rene Groeschke wrote:

> Hi Adam,
> it seems to be a problem with gmetrics 0.3 and ant 1.7.1. declaring the
> ant artifact before the gmetrics artifacts works for all tests.
> declaring the ant artifact after the gmetrics artifact fails for 2
> tests. strange.

gmetrics 0.3 depends on ant:ant:1.6.5
Ant 1.7.1 was released as org.apache.ant:ant:1.7.1

That is, they have different (group, name) values. And so, the conflict 
management isn't going to kick in and choose one over the other, and both of 
them will end up in the test classpath. Hence the ordering problem you see.

I'd love to introduce the concepts of api and implementation to Gradle's 
dependency management so we can deal with this kind of situation (amongst other 
things). Both ant:ant:1.6.5 and org.apache:ant:1.7.1 are different 
implementations of the Ant API. There should be a way to tell Gradle this, so 
that it can apply conflict management. There's plenty of examples of this kind 
of thing: groovy and groovy-all both implement the Groovy API. Or log4j and 
log4j-over-slf4j both implement the log4j API.


> 
> thx,
> rené
> 
> 
> Am 04.11.10 00:34, schrieb Adam Murdoch:
>> On 03/11/2010, at 4:12 PM, Rene Groeschke wrote:
>> 
>>> Hi there,
>>> Since the maven build of codenarc takes ages to resolve all unnecessary
>>> artifacts and create 3 simple artifacts, I'm porting the codenarc
>>> project build to gradle.
>>> 
>>> Codenarc has dependencies to ant 1.7.1. but gradle uses ant 1.8.1. When
>>> I run the codenarc tests I get a NoSuchMethodError. running the tests
>>> with "mvn test" works fine. It seems, that the resolved 1.7.1 version of
>>> ant is shadowed in the classpath by the gradle internal 1.8.1 ant. I
>>> thought this is a known issue, but can't find a jira for that problem.
>> It depends how you're running the tests. Are you using the Gradle test task? 
>> An Ant task?
>> 
>> If you're using the Gradle test task, your tests will run against the 
>> version of Ant which you specify in your test runtime classpath. You can run 
>> with -d to check this is the case.
>> 
>> If you're using an Ant task, you'll use the version of Ant which comes with 
>> Gradle.
>> 
>> 
>> --
>> Adam Murdoch
>> Gradle Developer
>> http://www.gradle.org
>> CTO, Gradle Inc. - Gradle Training, Support, Consulting
>> http://www.gradle.biz
>> 
>> 
> 
> 
> -- 
> ------------------------------------
> Rene Groeschke
> 
> r...@breskeby.com
> http://www.breskeby.com
> http://twitter.com/breskeby
> ------------------------------------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>    http://xircles.codehaus.org/manage_email
> 
> 


--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz

Reply via email to