To generate the Ant build.xml file, you need to select the Generate Ant build.xml file in the Java code generation options tab.
To use Ant, you need to:
Download Ant from http://www.apache.org and install it.
Define an environment variable ANT_HOME and set it to your Ant installation directory.
Download junit-3.8.1.jar if you don't have it.
Copy junit-3.8.1.jar to $ANT_HOME/lib directory.
Make sure that you have defined database connection parameters and JDBC driver jar correctly.