ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laun Thomas (CI/TMP)" <>
Subject AW: Design Library Folder Structure
Date Thu, 13 Aug 2009 07:55:23 GMT
Hello Kumar,

I have a similar use case. I see the following options:

1. Use two retrieve operations

The first retrieve will download your project stuff, the second retrieve will download your
third-party stuff:

<ivy:retrieve pattern="${build.lib}/project/[conf]/[artifact]-[revision].[ext] conf="!third-party"
<ivy:retrieve pattern="${build.lib}/project/[conf]/[artifact]-[revision].[ext] conf="third-party".../>

2. Move the files after download

As an alternative, you download everything with one retrieve to separate directories. As a
second step, you move all directories that are not third-party below the subdir "project".

3. Extra attribute

If you control the pom/ivy file of the project artifacts and if they are always downloaded
to the same subdirectory, you could add an extra attribute in the module descriptor (aka ivy.xml)
which defines the directory. You can then use the extra attribute in your retrieve pattern.

<ivy-module version="2.0" xmlns:e="">
  <info ... e:target="project/inhouse-project1" .../>

You can then retrieve your artifacts like this (note the missing e: before target):

<ivy:retrieve pattern="${build.lib}/[target]/[artifact]-[revision].[ext] .../>

This last approach does not need configurations for defining the destination.

You can find the documentation for extra attributes here:

4. Simplify your lib directory

Finally, there is the question why do you need the subfolders at all? Can't you structure
your lib directory in a more simple fashion? At least think about if you really need such
a complex structure.

Mit freundlichen Grüßen / Best regards

Thomas Laun

Robert Bosch GmbH
Telemedicine Platform  (CI/TMP)
Postfach 11 27
71301 Waiblingen

Tel. +49 (711) 811-3607689
PC-Fax +49 (711) 811-51849753

Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000;
Aufsichtsratsvorsitzender: Hermann Scholl; Geschäftsführung: Franz Fehrenbach, Siegfried
Bernd Bohr, Rudolf Colm, Volkmar Denner, Gerhard Kümmel, Wolfgang Malchow, Peter Marks,
Peter Tyroller; Uwe Raschke

-----Ursprüngliche Nachricht-----
Von: malepati []
Gesendet: Wednesday, August 12, 2009 8:42 PM
Betreff: Re: Design Library Folder Structure

I have tired different configurations as follows:
                <conf name="inhouse-project1.jar"  description="lists all
tcs dependency jars"/>
                <conf name="inhouse-project2.jar"  description="lists all
tcs dependency jars"/>
                <conf name="third-party"  description="lists all tcs_common

<dependency org="webprojects" name="module1" rev="LATEST"
<dependency org="webprojects" name="module2" rev="LATEST"
<dependency org="apache" name="apache" rev="LATEST"

now my project library folder structure is:
 !       !_module1.jar
 !       !_module2.jar

but i am looking for :
 !    !
 !    !_inhouse-project1
 !    !       !_module1.jar
 !    !_inhouse-project2
 !            !_module2.jar

Please share your views.


topher1120 wrote:
> Hi Kumar,
> To me, it depends on if you are talking about a structure in your build,
> or
> in the ivy cache.  If in the ivy cache, I'm not sure it's possible.  If
> you
> want that structure in your build, I think it's possible using different
> configurations and the <ivy:retrieve> Ant task.  In my ivy.xml, I have a
> few
> different configurations.  For example, I have one for compiling the
> production code (compile), and one for what I need for unit tests (test).
> Then at different points in my Ant script, I use <ivy:retrieve> to
> retrieve
> a specific configuration into a specific directory.
> My compile retrieve call looks like:
> <ivy:retrieve
> pattern="${build.lib}/[artifact]-[revision](-[classifier]).[ext]"
> sync="true" conf="compile" />
> My test retrieve call looks like:
> <ivy:retrieve
> pattern="${build.unittest.lib}/[artifact]-[revision](-[classifier]).[ext]"
> sync="true" conf="test" />
> Hope this helps.
> Thanks,
> topher
> On Wed, Aug 12, 2009 at 8:03 AM, malepati <> wrote:
>> Hello Every one,
>> I have a question:
>> I want to create a custom library folder structure, is this possible thru
>> ivy.xml ?
>> Example:
>> .libs
>>  !
>>  !__Folder1
>>  !     !
>>  !     !__Folder1.a
>>  !     !__Folder1.b
>>  !            !
>>  !            !_Folder1.b.i
>>  !
>>  !__Folder2
>>       !
>>       !__Folder2.a
>>       !__Folder2.b
>>            !
>>            !_Folder2.b.i
>> Is this possible with ivy?
>> because when I am trying to call one library i had to put all <includes>
>> and
>> <excludes>.
>> If i can create such kind of folder structure its easy for me to call a
>> particular folder when its necessary.
>> Please share your ideas.
>> --Kumar.
>> --
>> View this message in context:
>> Sent from the ivy-user mailing list archive at

View this message in context:
Sent from the ivy-user mailing list archive at

View raw message