To generate the Ant build.xml file, you need to select the Generate Ant build.xml file in the Java code generation window.
To use Ant, you need to:
Download it from http://www.apache.org and install it.
Define an environment variable ANT_HOME and set it to your Ant installation directory.
Copy junit-3.8.1.jar from HIBERNATE_HOME/lib directory to ANT_HOME/lib directory.
Make sure that the Hibernate Jar files are defined in the build.xml file or in the CLASSPATH environment variable.
Make sure that the JDBC driver Jar file of your database is defined in the build.xml file or in the CLASSPATH environment variable.