Return-Path: Delivered-To: apmail-ant-ivy-user-archive@www.apache.org Received: (qmail 68617 invoked from network); 15 Jan 2008 16:39:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Jan 2008 16:39:54 -0000 Received: (qmail 20643 invoked by uid 500); 15 Jan 2008 16:39:44 -0000 Delivered-To: apmail-ant-ivy-user-archive@ant.apache.org Received: (qmail 20471 invoked by uid 500); 15 Jan 2008 16:39:44 -0000 Mailing-List: contact ivy-user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ivy-user@ant.apache.org Delivered-To: mailing list ivy-user@ant.apache.org Received: (qmail 20462 invoked by uid 500); 15 Jan 2008 16:39:44 -0000 Delivered-To: apmail-incubator-ivy-user@incubator.apache.org Received: (qmail 20451 invoked by uid 99); 15 Jan 2008 16:39:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jan 2008 08:39:44 -0800 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [212.227.126.187] (HELO moutng.kundenserver.de) (212.227.126.187) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jan 2008 16:39:17 +0000 Received: from [192.168.2.100] (p54BEE74A.dip.t-dialin.net [84.190.231.74]) by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis) id 0MKwh2-1JEoon1fvv-0005w8; Tue, 15 Jan 2008 17:39:20 +0100 Mime-Version: 1.0 (Apple Message framework v753) In-Reply-To: <635a05060801070501m1a80f6bama7327092b223b284@mail.gmail.com> References: <080688FD-B3CE-4CF2-A507-EBC0125312DC@dockter.biz> <635a05060801070501m1a80f6bama7327092b223b284@mail.gmail.com> Content-Type: multipart/alternative; boundary=Apple-Mail-5-917139682 Message-Id: From: Hans Dockter Subject: Re: Filtering optional dependencies of a pom module Date: Tue, 15 Jan 2008 17:39:15 +0100 To: ivy-user@incubator.apache.org X-Mailer: Apple Mail (2.753) X-Provags-ID: V01U2FsdGVkX1+97mivaP0lBqPDyx3aAmePZ8AqxjYJMrb/Bpl UeON4Gzsq0iqhyseAu0YZc6vvEUcPiKqo5HKyZxbC8QYYx9h6n PwTtSMuS034hf5zZJ2B6w== X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-5-917139682 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Jan 7, 2008, at 2:01 PM, Xavier Hanin wrote: > On Jan 5, 2008 7:59 PM, Hans Dockter wrote: > >> I have the following probably pretty common use case. It is an issue >> related to maven pom's. >> >> Let's say I declare a dependency on the groovy-all module. The >> groovy- >> all pom declares 9 optional dependencies. I need one of of the >> optional dependencies for my usage scenario of groovy-all. If you are >> a Maven2 users there is no good way of dealing with this situation. >> What you have to do, is to declare the optional dependency you want >> as a first level dependency in your pom. How can I deal with this in >> Ivy? The module descriptor created out of the pom, has two >> configurations I'm interested in. This is default (Maven's compile >> and runtime scope) and optional (all dependencies declared optional >> in the pom). Now I can do the following: >> >> > conf="compile->default,optional"/> >> >> This add all 9 optional dependencies to the compile configuration. >> But I want only one. As I understand Ivy, I can only apply exclude >> and include filtering to the master configuration. In this case that >> would mean I have to add 8 exclude statements to exclude the unwanted >> optional dependencies. Alternatively I could declare include >> statements for all the required dependencies. Both is pretty >> impractical. I would like to declare filters on the dependency >> configuration, to say something like: include MODULE_X of OPTIONAL > > How is this different from the use of the include element when > declaring the > dependency? > > Xavier I think there has been a misunderstanding on my side regarding the include element. I have missed the fact that In contrast to the exclude element, include does not apply to the dependencies of a dependency, but only to published artifacts of the dependency, right? What I have in mind is an include for (first level) dependencies of a dependency. I'm not sure if this is a good idea. I'm just looking for a good solution for the use case described above. Another question: The include and artifact element basically does the same, right? - Hans > > >> >> >> My work around right now is to do it the same way as I did with >> Maven. Declaring the optional dependency as a first level dependency. >> >> Is there a better solution to this problem or are there plans to >> provide one? I'm happy to file a Jira issue :) >> >> - Hans >> >> >> >> >> > > > -- > Xavier Hanin - Independent Java Consultant > http://xhab.blogspot.com/ > http://ant.apache.org/ivy/ > http://www.xoocode.org/ -- Hans Dockter Fon: ++49-30-44024684 Fax: ++49-30-44024685 http://www.dockter.biz --Apple-Mail-5-917139682--