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