title: Creating DDL scripts from Hibernate Annotation Classes Using ANT
body: <p>I’m trying to <strong>generate SQL DDL  from my Hibernate annotation beans using ANT</strong>, according to hibernate tools document I have created the following Ant script:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project name="yourmarketnet" default="all" basedir="."&gt;
  &lt;property name="build.dir" value="C:/Users/naim/Documents/NetBeansProjects/yourmarketnet/build" /&gt;
  &lt;target name="ddl_generation"&gt;
  &lt;!-- paths to required jars  --&gt;
  &lt;path location="web/WEB-INF/lib/hibernate-annotations.jar" /&gt;
  &lt;path location="web/WEB-INF/lib/ejb3-persistence.jar" /&gt;
  &lt;path location="web/WEB-INF/lib/hibernate-entitymanager.jar" /&gt;
  &lt;path location="web/WEB-INF/lib/javaassist.jar" /&gt;
  &lt;path location="web/WEB-INF/lib/hibernate-tools.jar"/&gt;
  &lt;path location="web/WEB-INF/lib/hibernate-entitymanager.jar" /&gt;
  &lt;path location="web/WEB-INF/lib/jboss-archive-browsing.jar" /&gt;
  &lt;path location="web/WEB-INF/lib/javaassist.jar" /&gt;
  
  &lt;taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask"&gt;
      &lt;/taskdef&gt;
      &lt;classpath&gt;
      &lt;!-- path of annotation beans --&gt;
  &lt;path location="${build.dir}/web/WEB-INF/classes/com/yourmarketnet/beans" /&gt;
  &lt;/classpath&gt;
  &lt;!-- output destination --&gt;
  &lt;hibernatetool destdir="${build.dir}"&gt;
  &lt;!-- were the annotation beans files are located--&gt;
  &lt;!-- list exporters here --&gt;
  &lt;hbm2ddl
  export="false"
  update="false"
  drop="true"
  create="true"
  outputfilename="myApps.ddl"
  delimiter=";"
  format="false"
  haltonerror="true"/&gt;
  &lt;/hibernatetool&gt;
  &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>However Im getting the following error: </p>
  
  <p>taskdef class org.hibernate.tool.ant.HibernateToolTask cannot be found
   using the classloader AntClassLoader[]</p>
  
  <p>I have checked my /lib &amp; folder and classpath hibernate-tools is present. </p>