简体   繁体   中英

Ant Target Clean is not executing

I am new to Ant. To starting working with Ant I created one ant builder file build.xml. Here is the sample file.

<path id="compile.classpath">
    <fileset dir="WebContent/WEB-INF/lib">
        <include name="*.jar"/>
    </fileset>
</path>

<target name="init">
    <mkdir dir="build/classes"/>
    <delete dir="dist" />
    <mkdir dir="dist" />
</target>

<target name="compile" depends="init" >
    <javac destdir="build/classes" debug="true" srcdir="src" includeantruntime="false">
        <classpath refid="compile.classpath"/>
    </javac>
</target>

<target name="war" depends="compile">
    <war destfile="dist/abc.war" webxml="WebContent/WEB-INF/web.xml">
        <fileset dir="WebContent"/>
        <lib dir="WebContent/WEB-INF/lib"/>
        <classes dir="build/classes"/>
    </war>
</target>

<target name="clean">
    <delete dir="dist" />
    <delete dir="build" />
</target>

Each target is running fine. My code is getting compiled, creating war file too, but last target named "clean" is not working. Ant is not showing any error message too.

Ant Version - 1.7.1, java Version - 1.6, OS - centos 6.5

如果您想在创建战争之前每次都运行清理目标,请如下更改初始化目标:

<target name="init" depends="clean">

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