ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 45944] Bug using the file element as a nested element in the Copy task
Date Mon, 06 Oct 2008 12:52:37 GMT

Stefan Bodewig <> changed:

           What    |Removed                     |Added
          Component|Core                        |Core tasks
         OS/Version|Linux                       |All

--- Comment #1 from Stefan Bodewig <>  2008-10-06 05:52:37 PST ---
The issue here is that a file resource represents an absolute path unless you
also set the basedir attribute.

If you don't specify a mapper, the identity-mapper will be used in order to
determine the target file name, which in the case of an absolute path is the
file itself.

If you change you example to either

  <copy todir="dest">
          <file basedir="src_dir" file="file1.txt"/>
          <file basedir="src_dir" file="file2.txt"/>


  <copy todir="dest" flatten="true">
          <file file="src_dir/file1.txt"/>
          <file file="src_dir/file2.txt"/>

it will copy the files.

I completely agree this is inconsistent with the docs, but I think the docs are
wrong and need to talk about resources returning absolute paths.  I don't
really know how <copy> is supposed to pick the target file names from our
examples - flatten seems both reasonable and arbitrary.

Before I go any further, I'm going to raise this on the dev list.

Configure bugmail:
------- You are receiving this mail because: -------
You are on the CC list for the bug.

View raw message