I am using Hibernate Tools to generate pojo and dao in my project. It is currently working in the Hibernate perspective using Run > Hibernate Code Generation... However, I want to automatize this as part of a more complex build where I need to do some pre-processing, running the hibernate code genaration and doing some post-processing. I have an Ant build file for doing this, but I don't know how to reference the Maven dependencies jar
<?xml version="1.0" ?>
<!DOCTYPE project>
<project name="Hibernate Tools hbm2java" default="gensrc">
<path id="tools">
<!--
Here {
-->
<path location="lib/hibernate-tools-4.3.1.CR1.jar"/>
<!-- more dependencies... -->
<!--
}
-->
...
</path>
<taskdef name="gen-src" classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="tools" />
<target name="gensrc">
...
</target>
</project>
I am getting this warning:
taskdef class org.hibernate.tool.ant.HibernateToolTask cannot be found using the classloader AntClassLoader[]
with the consequent build error:
BUILD FAILED
/.../hibernate-gen.xml:16: taskdef class org.hibernate.tool.ant.HibernateToolTask cannot be found using the classloader AntClassLoader[]
How can I reference the jar from Maven dependency to call the org.hibernate.tool.ant.HibernateToolTask?