Mike
Mike

Reputation: 3575

Why my Ant delete does not work?

Using Ant 1.8.0

<target name="main">
    <delete includeEmptyDirs="true">
        <fileset dir="target/xxx/WEB-INF/lib" casesensitive="yes">
            <filename name="junit-*.jar"/>
            <filename name="gin-*.jar"/>
        </fileset>
    </delete>
</target>

When I run this Ant script, nothing happened, if I leave only one seem it works. I checked out the Ant FileSet Type, http://ant.apache.org/manual/Types/fileset.html, seem two does not matter.

So anybody who can tell me what's the problem here?

Upvotes: 0

Views: 139

Answers (1)

highlycaffeinated
highlycaffeinated

Reputation: 19867

The delete isn't succeeding because your files don't match both of the filename selectors you specified. From the docs:

If any of the selectors within the FileSet do not select the file, the file is not considered part of the FileSet. This makes a FileSet equivalent to an <and> selector container.

Upvotes: 1

Related Questions