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