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