ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin van Wieringen <>
Subject RE: W2000 SP1 Delete task does nothing
Date Tue, 22 Jan 2002 08:35:19 GMT

Some more info.

Here is the complete build file.

<project name="test" default="dist" basedir=".">

  <!-- set global properties for this build -->
  <property name="src" value="."/>
  <property name="build" value="build"/>
  <property name="dist"  value="dist"/>
  <property name="tools.jar" value="${java.home}/lib/tools.jar"/>

  <!-- Build classpath -->
  <path id="classpath">
   <fileset dir="./lib">
    <include name="**/*.jar"/>
     <pathelement location="${tools.jar}"/>

  <target name="init">
    <!-- Create the time stamp -->
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}"/>

  <target name="compile" depends="init">
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}">
        <classpath refid="classpath"/>

  <target name="dist" depends="compile">
    <!-- Create the distribution directory -->
    <mkdir dir="${dist}/lib"/>

    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file 
    <jar jarfile="${dist}/lib/test.jar" basedir="${build}"/>

  <target name="clean">
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${build}"/>


As you can see it the build file is the simpelest possible. I copied it 
from the documentation.

The property build is know to the clean tak.

The output I get is this:

Buildfile: build.xml


    [javac] Compiling 1 source file to C:\_test\build

      [jar] Building jar: C:\_test\dist\lib\Test.jar


Total time: 3 seconds

So it does not seem to execute the target clean or it has not result. I 
assume you also see clean: in the output? It is the last target but I do 
not see a reason why ant would not execute it. I assume the expected result 
of the clean task is that it would delete the 1 class file that it 
contains. The test.class. I would expect it would simply delete any file in 
the build directory but it does not delete any file. Or is that not the 
case in normal behavior? Is there a way to display errormessage on the 
clean task or should it do this already and are there simply no 

I am using windows 2000 with SP1 and jdk 1.3.1. Using ant 1.3. I already 
tried moving the clean task to right after the properties but that does not 


Martin van Wieringen

> I am also using w2k sp1 and the delete task works just as
> advertised (on
> different windows machines, and even on a linux box). I don't
> know what the
> problem is, but I guess it is specific to your environment.
> Do you have any
> more info we can work with?
> Ylan Segal.

> Maybe you havent defined the properties at this point

Steve Loughran

>What does the output look like? Do you see the [delete]? Are you sure the
>target is actually being run?


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message