Skip to Content

1) name    –

> Name of the project.

2) default –

> default target to build.

3) basedir –

> root directory of the project.

1) name    –

> Name of the target.

2) depends –

> defines the dependencies for the target.

3) basedir –

> defines the directory for the target.

<javac srcdir=”$”  destdir=”$” classpath=”xyz.jar” debug=”on”/>


compiles all .java files under the $ directory, and stores the .class files in the $ directory.
The classpath used includes xyz.jar, and compiling with debug information is on.


b) Compiling the File with include,exclude parameter


<textarea name=”sample1″ rows=”6″ cols=”55″ wrap=”virtual”>
     <javac destdir=”$” classpath=”xyz.jar”  debug=”on”>

             <src path=”$“/>

              <src path=”$“/>


         <jar destfile=”$/lib/app.jar”  basedir=”$/classes”  includes=”mypackage/test/**”
         excludes=”**/Test.class” />



jars all files in the $/classes directory into a file called app.jar in the $/lib directory.

Only files under the directory mypackage/test are used, and files with the name Test.class are excluded.

         <zip destfile=”$/” basedir=”htdocs/manual” />


Ant tasks

1) Archive Tasks (Jar, Ear, Tar, War, GZip, Zip etc.)

2) Audit/Coverage Tasks (JDepend, JPorbe, MMetrics, etc. )

3) Compile Tasks (javac, jspc, rmic etc.)

4) Deployment Tasks (ServerDeploy)

5) Documentation Tasks (Javadoc, Stylebook)

6) EJB Tasks

7) Execution Tasks (Ant, Antcall, Exec, Java, Sleep etc.)

8) File Tasks (Attrib, Copy, Copydir, delete, Mkdir etc.)

9) Java2 Extensions Tasks (Jarlib-available, Jarlib-display etc.)

10) Logging Tasks (Record)

11) Mail Tasks (Mail, MimeMail)

12) Miscellaneous Tasks (Echo, GenKey, Script, Sql etc.)

13) Pre-process Tasks (ANTLR, AntStructure, Import, Xslt/Style etc.)

14) Property Tasks (Available, Basename, BuildNumber, LoadFile etc.)

15) Remote Tasks (FTP, Telnet etc. )

16) SCM Tasks (Cvs, CvsChangeLog, CVSPass etc.)

17) Testing Tasks (Junit, JunitReport, Test)

Options  to use Ant

Implementing Ant in Web Application Server

Preliminary Setup :-

1) Create a Java project

2) Next go to project Java Build Path and add the following jar files



From(SAP – Home)Dir:/Program Files/SAP/JDT/eclipse/plugins/org.apache.ant_1.5.3

3) Create a build.xml (Depends on the rerequirements)

4)Run the project using Ant Utilities

To be Continued……..

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply