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