On Wed, Mar 3, 2010 at 7:47 AM, Pepijn Van Eeckhoudt <
[email protected]> wrote:

> 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}" )
>

Personally, I would not use transitive() here at runtime.   I would run
transitive() to obtain the list of new dependencies and explicitly set the
manually-corrected list,

 @dependencies ||= [ "net.sourceforge.cobertura:cobertura:jar:1.9.4",
"log4j:log4j:jar:1.2.9",
  "asm:asm:jar:3.0", "asm:asm-tree:jar:2.2.1", "oro:oro:jar:2.0.8"]


> 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?
>

Independently of the above, I think this would be a worthwhile improvement
to transitive() ... I think somebody else (Chetan?) had the same need just a
week ago.  My only warning is that it's a slippery slope from there... you
get into version number comparison issues quickly and there's little
consistency there, or you want to exclude dependencies of another
dependency, ... things like that.

alex

Reply via email to