I'm bumping in to a general problem with ant task versions, but I'll use cobertura as a concrete example.

The cobertura extension lists its dependencies as
@dependencies ||= [ "net.sourceforge.cobertura:cobertura:jar:#{version}", "log4j:log4j:jar:1.2.9", "asm:asm:jar:2.2.1", "asm:asm-tree:jar:2.2.1", "oro:oro:jar:2.0.8"]

version can be modified via build.yml, but if you actually do this (e.g. update to cobertura 1.9.4) the dependencies list is no longer correct since cobertura 1.9.4 requires asm 3.0.

The simple way to correct this would be to replace the dependencies with
@dependencies ||= Buildr.transitive( "net.sourceforge.cobertura:cobertura:jar:#{version}" )

but then you end up including ant 1.7.0 since it is listed in coberturas pom file.

I guess it's simple enough to just reject org.apache.ant* from the transitive list, but due to the way transitive works, buildr is going to try to download the ant 1.7.0 pom anyway (see POM.dependencies). I'm using an internal repository instead of maven central and ant 1.7.0 is not available there so this fails and this in turns causes the entire build to fail.

Long story short, I think it would be useful to extend transitive with a means to eagerly filter out dependencies (perhaps via a block?). This would have to be passed on to POM.dependencies as well to get everything working correctly. Does this sound like a useful addition or is there a better way to tackle this?

Pepijn

Reply via email to