<move>

The <move> task gives you the ability to move a file or set of files to a different directory. Either the file attribute or a fileset can be specified, but in both cases, if the destination file already exists, it will be overwritten by default. A more refined use is to set the overwrite attribute to false, in which case, an existing file will be overwritten only if the candidate to replace it is newer. A full list of attributes is given in Table 4.63.

<move> can also be used to rename a file using the file and tofile attributes. Furthermore, a nested mapper element can be used to rename sets of files.

Table 4.63. Table of <move> Attributes
Attributes Description
Required
file (required if fileset elements are not specified) The name ...

Get Ant Developer’s Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.