LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

ant

Java-based build automation tool

TLDR

Run default target
$ ant
copy
Run specific target
$ ant [build]
copy
Run with build file
$ ant -f [build.xml] [target]
copy
Run with property
$ ant -Dproperty=[value] [target]
copy
List available targets
$ ant -p
copy
Run quietly
$ ant -q [target]
copy

SYNOPSIS

ant [-f buildfile] [-D property=value] [options] [target]

DESCRIPTION

ant (Another Neat Tool) is a Java-based build tool using XML configuration files. It automates software build processes including compiling, testing, packaging, and deploying Java applications.Build files (typically build.xml) define targets containing tasks. Ant executes tasks in dependency order, similar to make but using XML syntax and platform-independent operation.

PARAMETERS

-f file, -buildfile file

Build file (default: build.xml)
-D prop=val
Set property value
-p, -projecthelp
List available targets
-q, -quiet
Minimal output
-v, -verbose
Verbose output
-d, -debug
Debug output
-e, -emacs
Output without adornment
-S, -silent
Print nothing but task outputs and build failures
-k, -keep-going
Execute all targets that do not depend on failed targets
-lib path
Specify a path to search for jars and classes
-l file, -logfile file
Write log output to the given file
-logger classname
Class that performs logging
-propertyfile name
Load all properties from file (-D properties take precedence)
-noinput
Do not allow interactive input
-s file, -find file
Search for the buildfile towards the root of the filesystem and use it
-nice number
Niceness for the main thread: 1 (lowest) to 10 (highest), default 5
-diagnostics
Print information helpful for diagnosing problems and exit
-version
Show version

INSTALL

sudo dnf install ant
copy
sudo pacman -S ant
copy
sudo apk add apache-ant
copy
sudo zypper install ant
copy
brew install ant
copy
nix profile install nixpkgs#ant
copy

CAVEATS

Requires Java Runtime Environment. XML build files can become verbose for complex projects. Largely superseded by Maven and Gradle for modern Java projects.

HISTORY

Apache Ant was created by James Duncan Davidson as part of the Tomcat project, with the first standalone release in 2000. It was the dominant Java build tool until Maven gained popularity in the mid-2000s.

SEE ALSO

mvn(1), gradle(1), make(1)

RESOURCES

Copied to clipboard
Kai