简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM