ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Sher <>
Subject confusing artifacts retrieving
Date Wed, 19 Mar 2008 12:17:25 GMT

Is it possible to setup Ivy to not create the full artifact
directories structure during retrieve process? For example, I have the
following ivy.xml in the repository:

<ivy-module version="1.4">
  <info organisation="xxx" module="yyy" revision="1.1"/>
    <artifact name="file1" type="txt" ext="txt"/>
    <artifact name="dir1/file2" type="txt" ext="txt"/>
    <artifact name="dir1/dir2/file3" type="txt" ext="txt"/>
Suppose I want to retrieve all *.txt files and put then into the "dest"
directory without subfolders. I tried the following ivy.xml on the
client side: 

<ivy-module version="1.3" xmlns:xsi=""
  <info organisation="xxx" module="yyy"/>
    <dependency org="xxx" name="yyy" rev="1.1">
      <include name="*.txt" ext="txt" matcher="glob"/>

I used Ant retrieve task and as destination pattern I used:

But in this case retrieve task creates the following structure:

while I hoped to get this:

For me such behavior looks unnatural because in include rule I
specified "*.txt" and then asked to put matched files to the "dest"
directory (*.txt => dest). And I do not expect subfolders to be
created in this case (I would expect them to be created if pattern
looks like: */*.txt).

I know that I can use [originalname] keyword in the destination
pattern, and in this case it will help, but there are more complicated
use cases when this approach will not work.

For example suppose I am using the following include rule:
<include name="dir1/*/file3.txt" ext="txt" matcher="glob"/>

Or in simpler form: dir1/*/file3.txt => dest/[artifact].[ext]
In this case I expect the following structure:

But I'll get this:

While in my opinion such directory structure should be created if I am
using another pattern: */file3.txt. Because I expect that if pattern
starts with explicitly specified part of a path then this part should
be omitted in the destination directory and if I really need it I will
add it to the destination path pattern.

So the question is: is it possible to make Ivy retrieve artifacts in
this way? I agree to customize it via some plugins since I am already
using it programmatically.

Since Ivy is so highly integrated with Ant I hope that in the future
Ivy will support Ant like pattern matching which proved to be very

Pavel Sher
Software Developer
JetBrains, Inc.
"Develop with pleasure!"

View raw message