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