After correct environment configuration in "ant environment configuration problems", you can test ant build.
First, create the file helloant. XML with the following content:
<? XML version = "1.0"?>
<Project name = "helloant">
<Target name = "sayhello">
<Echo message = "Hello ant"/>
</Target>
</Project>
Then, go to the doscommand environment and enter the directory where the helloant. xml file is saved. Here E: \ ant-Exercise
Input:
E: \ ant-exercise> ant-F helloant. xml:
Buildfile: helloant does not exist!
Build failed
Change:
E: \ ant-exercise> ant-F helloant. xml sayhello carriage return will appear
Buildfile: e: \ ant-exercise \ helloant. xml
Sayhello:
[Echo] Hello ant
Build successful
Total time: 0 seconds
The test is successful.
Note: In E: \ ant-exercise> ant-F helloant. xml sayhello, the last sayhello is the name value of target in the helloant. xml file.