Ant copy task ignoring files

I have an Ant copy task (defined in a Maven script called by a Jenkins line) that seems to be correct, but does not copy correctly. The task is defined as

<copy todir="./Virgo/config" overwrite="true" verbose="true">
    <fileset dir="${config.folder}">
        <include name="*.properties, *.xml" />


When I run the task, I see the correct directory is specified, but the copy task does not select files. Both source and target directories exist and I am not getting any errors. What I see is this

14:52:40  [INFO] Executing tasks
14:52:40  [DEBUG] getProperty(ns=null, name=ant.reuse.loader, user=false)
14:52:40  [] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
14:52:40       [echo] Copying files from ../
14:52:40  fileset: Setup scanner in dir C:\Jenkins\workspace\container-build\\config with patternSet{ includes: [*.properties, *.xml] excludes: [] }
14:52:40  [INFO] Executed tasks


I tried adding the files to the source directory, making the source files newer than the ones in the destination, even deleting the files in the destination directory. My concern is that it fileset

doesn't seem to match any files even though the path is correct. Has anyone ever seen this behavior before?


source to share

1 answer

See the PatternSet section of the Ant manual:

Note that while the include and excludes attributes accept multiple elements, separated by commas or spaces, nested <include>

and <exclude

> elements expect their name attribute to contain the same pattern.

You can change your script to something like

<copy todir="./Virgo/config" overwrite="true" verbose="true">
    <fileset dir="${config.folder}">
        <include name="*.properties" />
        <include name="*.xml" />




All Articles