ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
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
https://issues.apache.org/bugzilla/show_bug.cgi?id=45944


Stefan Bodewig <bodewig@apache.org> changed:

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




--- Comment #1 from Stefan Bodewig <bodewig@apache.org>  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">
        <resources>
          <file basedir="src_dir" file="file1.txt"/>
          <file basedir="src_dir" file="file2.txt"/>
        </resources>
  </copy>

or

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

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: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Mime
View raw message