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