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