0ae3e84
ant(1)
0ae3e84
======
0ae3e84
:doctype:       manpage
0ae3e84
:man source:    ANT
0ae3e84
:man manual:    Apache Ant
0ae3e84
0ae3e84
NAME
0ae3e84
----
0ae3e84
ant - Java build tool
0ae3e84
0ae3e84
SYNOPSIS
0ae3e84
--------
0ae3e84
*ant* [OPTIONS] [TARGET [TARGET2 [TARGET3] ...]]
0ae3e84
0ae3e84
DESCRIPTION
0ae3e84
-----------
0ae3e84
Apache Ant is a Java library and command-line tool whose mission is to drive
0ae3e84
processes described in build files as targets and extension points dependent
0ae3e84
upon each other. The main known usage of Ant is the build of Java applications.
0ae3e84
Ant supplies a number of built-in tasks allowing to compile, assemble, test and
0ae3e84
run Java applications. Ant can also be used effectively to build non Java
0ae3e84
applications, for instance C or C++ applications. More generally, Ant can be
0ae3e84
used to pilot any type of process which can be described in terms of targets
0ae3e84
and tasks.
0ae3e84
0ae3e84
USAGE
0ae3e84
-----
0ae3e84
When no arguments are specified, Ant looks for a build.xml file in the current
0ae3e84
directory and, if found, uses that file as the build file and runs the target
0ae3e84
specified in the default attribute of the <project> tag. To make Ant use
0ae3e84
a build file other than build.xml, use the command-line option *-buildfile*
0ae3e84
file, where file is the name of the build file you want to use (or a directory
0ae3e84
containing a build.xml file).
0ae3e84
0ae3e84
If you use the *-find* [file] option, Ant will search for a build file first in
0ae3e84
the current directory, then in the parent directory, and so on, until either
0ae3e84
a build file is found or the root of the filesystem has been reached. By
0ae3e84
default, it will look for a build file called build.xml. To have it search for
0ae3e84
a build file other than build.xml, specify a file argument. Note: If you
0ae3e84
include any other flags or arguments on the command line after the *-find*
0ae3e84
flag, you must include the file argument for the *-find* flag, even if the name
0ae3e84
of the build file you want to find is build.xml.
0ae3e84
0ae3e84
You can also set properties on the command line. This can be done with the
0ae3e84
*-Dproperty*=value option, where property is the name of the property, and
0ae3e84
value is the value for that property. If you specify a property that is also
0ae3e84
set in the build file (see the property task), the value specified on the
0ae3e84
command line will override the value specified in the build file. Defining
0ae3e84
properties on the command line can also be used to pass in the value of
0ae3e84
environment variables; just pass *-DMYVAR*=$MYVAR to Ant. You can then access
0ae3e84
these variables inside your build file as ${MYVAR}. You can also access
0ae3e84
environment variables using the property task's environment attribute.
0ae3e84
0ae3e84
Options that affect the amount of logging output by Ant are: *-quiet*, which
0ae3e84
instructs Ant to print less information to the console; *-verbose*, which
0ae3e84
causes Ant to print additional information to the console; *-debug*, which
0ae3e84
causes Ant to print considerably more additional information; and *-silent*
0ae3e84
which makes Ant print nothing but task output and build failures (useful to
0ae3e84
capture Ant output by scripts).
0ae3e84
0ae3e84
It is also possible to specify one or more targets that should be executed.
0ae3e84
When omitted, the target that is specified in the default attribute of the
0ae3e84
project tag is used.
0ae3e84
0ae3e84
The *-projecthelp* option prints out a list of the build file's targets.
0ae3e84
Targets that include a description attribute are listed as "Main targets",
0ae3e84
those without a description are listed as "Other targets", then the "Default"
0ae3e84
target is listed ("Other targets" are only displayed if there are no main
0ae3e84
targets, or if Ant is invoked in *-verbose* or *-debug* mode).
0ae3e84
0ae3e84
OPTIONS
0ae3e84
-------
0ae3e84
0ae3e84
*-help, -h*::
0ae3e84
print this message and exit
0ae3e84
*-projecthelp, -p*::
0ae3e84
print project help information and exit
0ae3e84
*-version*::
0ae3e84
print the version information and exit
0ae3e84
*-diagnostics*::
0ae3e84
print information that might be helpful to diagnose or report problems and exit
0ae3e84
*-quiet, -q*::
0ae3e84
be extra quiet
0ae3e84
*-silent, -S*::
0ae3e84
print nothing but task outputs and build failures
0ae3e84
*-verbose, -v*::
0ae3e84
be extra verbose
0ae3e84
*-debug, -d*::
0ae3e84
print debugging information
0ae3e84
*-emacs, -e*::
0ae3e84
produce logging information without adornments
0ae3e84
*-lib <path>*::
0ae3e84
specifies a path to search for jars and classes
0ae3e84
*-logfile <file>, -l <file>*::
0ae3e84
use given file for log
0ae3e84
*-logger <classname>*::
0ae3e84
the class which is to perform logging
0ae3e84
*-listener <classname>*::
0ae3e84
add an instance of class as a project listener
0ae3e84
*-noinput*::
0ae3e84
do not allow interactive input
0ae3e84
*-buildfile <file>, -file <file>, -f <file>*::
0ae3e84
use given buildfile
0ae3e84
*-D<property>=<value>*::
0ae3e84
use value for given property
0ae3e84
*-keep-going, -k*::
0ae3e84
execute all targets that do not depend on failed target(s)
0ae3e84
*-propertyfile <name>*::
0ae3e84
load all properties from file with *-D* properties taking precedence
0ae3e84
*-inputhandler <class>*::
0ae3e84
the class which will handle input requests
0ae3e84
*-find <file>, -f <file>*::
0ae3e84
search for buildfile towards the root of the filesystem and use it
0ae3e84
*-nice number*::
0ae3e84
A niceness value for the main thread:
0ae3e84
1 (lowest) to 10 (highest); 5 is the default
0ae3e84
*-nouserlib*::
0ae3e84
Run ant without using the jar files from `${user.home}/.ant/lib`
0ae3e84
*-noclasspath*::
0ae3e84
Run ant without using `CLASSPATH`
0ae3e84
*-autoproxy*::
0ae3e84
Java1.5+: use the OS proxy settings
0ae3e84
*-main <class>*::
0ae3e84
override Ant's normal entry point
0ae3e84
0ae3e84
EXAMPLES
0ae3e84
--------
0ae3e84
*ant*::
0ae3e84
0ae3e84
runs Ant using the build.xml file in the current directory, on the default target.
0ae3e84
0ae3e84
*ant -buildfile test.xml*::
0ae3e84
0ae3e84
runs Ant using the test.xml file in the current directory, on the default target.
0ae3e84
0ae3e84
*ant -buildfile test.xml dist*::
0ae3e84
0ae3e84
runs Ant using the test.xml file in the current directory, on the target called dist.
0ae3e84
0ae3e84
*ant -buildfile test.xml -Dbuild=build/classes dist*::
0ae3e84
0ae3e84
runs Ant using the test.xml file in the current directory, on the target called dist, setting the build property to the value "build/classes".
0ae3e84
0ae3e84
*ant -lib /home/ant/extras*::
0ae3e84
0ae3e84
runs Ant picking up additional task and support jars from the /home/ant/extras location
0ae3e84
0ae3e84
*ant -lib one.jar;another.jar*::
0ae3e84
0ae3e84
adds two jars to Ants classpath.
0ae3e84
0ae3e84
FILES
0ae3e84
-----
0ae3e84
The Ant wrapper script for Unix will source (read and evaluate) the file *~/.antrc* before it does anything. You can use the file, for example, to set/unset environment variables that should only be visible during the execution of Ant.
0ae3e84
0ae3e84
ENVIRONMENT VARIABLES
0ae3e84
---------------------
0ae3e84
The wrapper scripts use the following environment variables (if set):
0ae3e84
0ae3e84
JAVACMD::
0ae3e84
full path of the Java executable. Use this to invoke a different JVM than JAVA_HOME/bin/java.
0ae3e84
ANT_OPTS::
0ae3e84
command-line arguments that should be passed to the JVM. For example, you can define system properties or set the maximum Java heap size here.
0ae3e84
ANT_ARGS::
0ae3e84
Ant command-line arguments. For example, set ANT_ARGS to point to a different logger, include a listener, and to include the *-find* flag.
0ae3e84
Note: If you include *-find* in ANT_ARGS, you should include the name of the build file to find, even if the file is called build.xml.
0ae3e84
0ae3e84
SEE ALSO
0ae3e84
--------
0ae3e84
java(1), make(1), mvn(1)