Ant Property Task - Apache Ant

What is Ant Property Task?

Ant build files are written in XML, which does not permit declaring variables as you do on your preferred programming language. but, as you can have imagined, it would be useful if Ant allowed declaring variables such as project name, project supply listing, etc.

Ant uses the Property detail which permits you to specify properties. This allows the properties to be changed from one build to another or from one environment to another.

Through default, Ant presents the following pre-described properties that may be used within the build file:




The full location of the build file.


The version of the Apache Ant installation.


The basedir of the build, as specified in thebasedirattribute of theprojectelement.

The version of the JDK that is used by Ant.

The name of the project, as specified in thenameatrribute of theprojectelement.


The default target of the current project.


Comma separated list of the targets that were invoked in the current project.


The full location of the Ant jar file.


The home directory of Ant installation.


The home directory for Ant library files - typically ANT_HOME/lib folder.

Ant also makes the system properties (example: report.separator) available to the build file.

Similarly to the above, the user can define additional properties the use of the Property detail. the following example indicates the way to outline a property called sitename:

Running Ant on the above build file produces the following output:

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Apache Ant Topics