3 Replies Latest reply on Jan 31, 2012 3:11 PM by Adam Warski

    ant task requires HibernateToolTask

    Claudio Miranda Expert

      Trying to create the audit tables. My current persistence.xml has hibernate.hbm2ddl.auto=none.


      I created the build.xml to export the auditable tables, but there is a error


      /build.xml:24: taskdef A class needed by class org.hibernate.tool.ant.EnversHibernateToolTask cannot be found: org/hibernate/tool/ant/HibernateToolTask


      But org/hibernate/tool/ant/HibernateToolTask class is not part of hibernate 4 at hibernate-release-4.0.0.Final/lib/required/hibernate-core-4.0.0.Final.jar


      I see there is org/hibernate/tool/hbm2ddl/ package, but the v is not there. I tried to use jboss-tools jar 3.4.0.CR2-SNAPSHOT but it requires class org.hibernate.util.ReflectHelper that is part of hibernate 3

      Caused by: java.lang.ClassNotFoundException: org.hibernate.util.ReflectHelper


      So, how to generate the envers auditable tables  with hibernate.hbm2ddl.auto=none ?


      To force the schema generation, hibernate.hbm2ddl.auto=create-drop, but it will drop all jpa tables from my database, and that is not desirable.