buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Toulme <>
Subject Re: Detect duplicate deps for :war packages
Date Tue, 25 Aug 2009 08:43:27 GMT
That's part of the price to pay for transitive dependencies, and you should
do your own home brewed ruby script to deal with duplicate dependencies your
own way.

Here is a way to do it:
libs = [project('core').compile.dependencies,

libs_by_id = {}
libs.each do |lib|
  lib = artifact(lib)
  if libs_by_id[].nil?
   libs_by_id[] = lib
    libs_by_id[] = lib if libs_by_id[].version < lib.version

libs = libs_by_id.values

that's not related to war packaging at all, that works in any packaging.
If you want to specify version, you can do so by acting on the versions as I

On Tue, Aug 25, 2009 at 09:24, Martin Grotzke

> Hi,
> this is related to my other post: I want to detect duplicate artifacts
> for a package of type war. For a "webapp" subproject it might look like
> this:
>  package(:war).with :libs=>[project('core').compile.dependencies,
> compile.dependencies]
> For us this leads to several duplicate libs in WEB-INF/lib that I would
> like to filter out.
> Also a good thing would be to be able to specify which version to use
> for a certain artifact.
> I also found the artifact_namespace.rb, which seems to allow more
> advanced artifact handling, but I don't see if this would help in this
> situation. Right now we specify artifacts dead simple like
> FOO = transitive('group:id:type:version')
> and use this in project.compile.with.
> Any hints how to improve this situation?
> Thanx && cheers,
> Martin

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message