Initially, it was not an easy task to work on
the large java projects but thanks to ant for
simplifying the complex details apart from the
development concepts that the software
developers have to keep in regard while
developing the java software.
To understand more clearly, Let’s view a
project development scenario without the ant
tool where you need to work on a large Java
project without any project-building tool. This
project consist of multiple java files, classes
depending on other classes, stubs or drivers
classes situated in multiple directories,
additionally the output files are required to
save to different locations. If you are
coordinating all of this manually then so many
of the development hours are spent in
changing directories compiling individual files
and so on. This consumes a lot of time and
increases the development stress and hassle.
However, if you have gone for any projectbuilding
tool like ant then you would have
saved a lot of development time and reduced
the stress to a great extent.
Ant (originally an acronym for Another Neat
Tool), is a build tool with special support for
the Java programming language but can be
used for just about everything. Ant is
platform-independent like java. Ant is
particularly good at automating complicated
repetitive tasks and thus is well suited for
automating standardized build processes. Ant
accepts an instruction in the form of XML
documents thus is extensible and easy to
Apache Ant is a software tool, which is similar
to “make” but is written in the Java language,
requires the Java platform, and is best suited
to building Java projects. Noticeable difference
between Ant and make is that Ant uses XML
to describe the build process and its
dependencies, whereas make has its Makefile
format. In ant, the XML file is always named
as the build.xml.
Ant is an Apache project. It is open source
software and is released under the Apache
Ant allows the developer to automate the
repeated process involved in the development
of JEE application. Developers can easily write
the script to automate the build process like
compilation, archiving and deployment.
Getting Hands-On Ant
For this article I am using jdk1.6.0 and
Application Server JBoss 3.2.3 to deploy and
test JEE application.
Downloading and Installing Ant
- Before installing Ant make sure you
have JDK1.3 or above installed on your
- Download ant from
unzip the file into your favorite directory.
- Set the class path to the bin directory of
Let’s assume that Ant has been installed in
Put the following code in the autoexec.bat
Let’s Test The Ant
Go to command prompt and issue the
Buildfile: build.xml does not exist!Build
If every thing has been installed properly then
the Ant will give the message as shown
Now its time to do some work with Ant.
Ant always uses the default configuration file
called build.xml to work. This is the file
where you define the process of compiling,
building and deploying the application.
Writing build.xml filebuild.xml is a xml file
used by ant utility to compile, build and
deploy the application.
Dec 2007 | Java Jazz Up | 35
|View All Topics
|All Pages of this Issue