Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Target Clean does not exist in the project dir

I have installed Ant in my centos 6.3 , installed location are /opt/ant and also ANT_HOME env are same

I have created build.xml to test by deleting testdir. This directory exist in the /opt/ant/testdir like this.

build.xml

<?xml version="1.0"?>
<project name="testdir" default="all" basedir=".">
  <property name="src"   value="src"/>
    <property name="build" value="build"/>
      <property name="lib"   value="lib"/>

    <target name="all" depends="clean, compile" description="Builds the whole project">
        <echo>Doing all</echo>
    </target>

    <target name="clean">
        <echo message="Deleting bin/java ..." />
        <delete dir="testdir/test" />
    </target>
</project>

Using Command :-

    ant -buildfile build.xml Clean

getting error:-

    BUILD FAILED
    Target "Clean" does not exist in the project "testdir".

Any suggestion to make it work?

like image 878
Roopendra Avatar asked Dec 27 '25 15:12

Roopendra


1 Answers

You mis-spelt the target name ? 'Clean' as against 'clean' ??

like image 61
jacquard Avatar answered Dec 31 '25 07:12

jacquard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!