3.3 Running Ant

3.3.1 Problem

You want to run Ant.

3.3.2 Solution

The complete command-line syntax is as follows:

ant [options] [target [target2 [target3] ...]]

3.3.3 Discussion

Table 3-1 lists all of the Ant command-line options. This table applies to Ant Version 1.5.1.

Table 3-1. Ant command-line options

Option

Description

-buildfile file

-f file

-file file

Specify which buildfile to use. If omitted, Ant searches for a file named build.xml.

-Dproperty=value

Pass name/value pairs as properties.

-debug

Write debugging information as the build progresses.

-diagnostics

Write diagnostic information as the build progresses.

-emacs

Write the log file in a way that Emacs understands.

-find file

Locate a buildfile. Start searching in this directory, then the parent directory, and so on until the file is found or the filesystem root is reached.

-help

Show these options.

-inputhandler classname

Use a custom input handler class.

-listener classname

Use a custom build listener class.

-logfile file

-l file

Send messages to the specified file instead of the console.

-logger classname

Use a custom logger class.

-projecthelp

Show a list of all targets in the buildfile.

-propertyfile name

Load all of the properties in the specified file. Properties specified with -D take precedence.

-quiet

-q

Suppress much of the output.

-verbose

-v

Write more information as the build progresses.

-version

Show the version of Ant.

3.3.4 See Also

Type ant -help to see the Ant options.