O'Reilly logo

Java and XSLT by Eric M. Burke

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 Documentation Stylesheet

Apache’s Ant has taken the Java development community by storm, supplementing traditional Java IDEs and outright replacing Makefiles on most Java development projects. Ant is a build tool, similar to the make utility, only it uses XML files instead of Makefiles. In addition to a portable build file based on XML, Ant itself is written in Java and has few platform-specific dependencies. Finally, since Ant can reuse the same running instance of the Java Virtual Machine for nearly every step of the build process, it is blazingly fast. Ant can be downloaded from http://jakarta.apache.org and is open source software.

Ant Basics

Ant is driven by an XML build file , which consists of one project . This project contains one or more targets , and targets can have dependencies on one another. The project and targets are represented as <project> and <target> in the XML build file; <project> must be the document root element. It is common to have a “prepare” target that builds the output directories and a “compile” target that depends on the “prepare” target. If you tell Ant to execute the “compile” target, it first checks to see that the “prepare” target has created the necessary directories. The structure of an Ant build file looks like this:

<?xml version="1.0"?> <project name="SampleProject" default="compile" basedir="."> <!-- global properties --> <property name="srcdir" value="src"/> <property name="builddir" value="build"/> <target name="prepare" description="Creates ...

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