ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brown, Carlton" <Carlton.Br...@compucredit.com>
Subject RE: Re[2]: confusing artifacts retrieving
Date Wed, 19 Mar 2008 17:20:58 GMT
 > -----Original Message-----
> From: Pavel Sher [mailto:Pavel.Sher@jetbrains.com] 
> Sent: Wednesday, March 19, 2008 12:58 PM
> To: Brown, Carlton
> Cc: ivy-user@ant.apache.org
> Subject: Re[2]: confusing artifacts retrieving
> 
> Hello Carlton,
> 
> ivy.xml in such form is generated by the server (TeamCity). 
> When we implemented ivy integration for the first time we 
> decided to choose this format because it looked natural. Now 
> server generates file where all artifacts (published by a 
> build) are listed with their directory structure.
> 
> If I understand you right I should probably use some logical 
> names for artifacts and encode directory structure in some 
> other place (for example, in organization). It is possible 
> but it does not solve my problem because I cannot affect the 
> way how Ivy creates destination folders. 

Sure you can.  If you refactor the ivy.xml to separate it into one
ivy.xml for each level of nesting, then you can use the artifact pattern
to flatten the retrieval.

This was your original example:
<ivy-module version="1.4">
  <info organisation="xxx" module="yyy" revision="1.1"/>
  <publications>
    <artifact name="file1" type="txt" ext="txt"/>
    <artifact name="dir1/file2" type="txt" ext="txt"/>
    <artifact name="dir1/dir2/file3" type="txt" ext="txt"/>
  </publications>
</ivy-module>

Split it into discrete ivy.xml files.  The third one may look like this:
<ivy-module version="1.4">
  <info organisation="dir1/dir2" module="file3" revision="1.1"/>
  <publications>
    <artifact name="file3" type="txt" ext="txt"/>
  </publications>
</ivy-module>

Now you can flatten the destination directory, and you don't need to
reorganize your repository:
<ivy:retrieve pattern="lib-retrieved/[artifact].[ext]" type="ext"/>

The result will be lib-retrieved/file3.txt which is what you wanted.

At this point you have to decide whether your client implementation will
do resolve+retrieve 3 times (one for each ivy.xml file), or alternately
set up the dependency relationships so that you can do it transitively
with one single resolve + retrieve.   This way you can avoid writing a
bunch of Ant goop to hold everything together.   At least that's how I
understand your situation.



-----------------------------------------
====================================================
This message contains PRIVILEGED and CONFIDENTIAL
information that is intended only for use by the 
named recipient. If you are not the named recipient,
any disclosure, dissemination, or action based on 
the contents of this message is prohibited. In such
case please notify us and destroy and delete all 
copies of this transmission.  Thank you.
====================================================

Mime
View raw message