O'Reilly logo

Java Enterprise in a Nutshell, Third Edition by William Crawford, Jim Farley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Ant Overview

Ant was developed in part as an improvement to previous build tools like make. At a high level, the improvements it offers include an improved command file format (using XML as the basis for its buildfiles) and the ability to extend the tool using Java code rather than shell script commands. In the past, many developers found the text format of make and its variants to be somewhat arcane and error-prone (to the point that people developed tools like imake, which provided a metalanguage for the generation of makefiles). An XML format is much more directly accessible to the average developer, the syntax rules are clearer since they are based on general XML syntax, and the plethora of XML tools can be used directly to edit Ant buildfiles.

The ability to extend the build tool using Java code is also an obvious advantage, at least to Java developers. As we’ll see later in this section, tasks in Ant are invoked using XML elements in the buildfile with a core set of tasks provided with the tool. Custom Ant tasks can also be written using Java code. This allows for more portable extensibility than earlier shell command systems, since the syntax of shell commands and their arguments tends to be platform-dependent.

Before we look at the model Ant uses for managing development tasks, let’s get familiar with the terminology of Ant.

Ant is driven from a buildfile that you write. This buildfile defines a set of project-specific targets that represent specific goals or results that you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required