This is a simple example that illustrates how to find the basedir name, file name, project name, ant version, java version, operating system name, ant home directory name, java home directory name, user home directory name and user name. Ant provides you with certain built-in properties that you may find useful during your build process. The following table shows the property name and it's description.
Ant's built-in properties:
|
Property |
Description |
|
ant.file |
The absolute path of the build file |
|
ant.project.name |
The name of the project as set in the <project> element's name attribute. |
|
ant.home |
The root directory of ant |
|
ant.version |
The version of this ant installation. This is not just the version number and includes information such as the compilation date. |
|
ant.java.version |
The version of the java that ant uses |
|
basedir |
The absolute path of the project |
|
os.name |
Operating system name |
|
java.home |
Java home directory name |
|
user.home |
User directory name |
|
user.name |
User name |
Source code of build.xml:
|
|
Run this program - the following output will be displayed:

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Ant built-in Properties View All Comments
Post your Comment