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