I have got the same problem. Now there is a Hibernate 4 Tools version:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-tools</artifactId>
<version>4.0.0-CR1</version>
</dependency>
But this Ant fragment does not export the audit tables, only the "basic" tables:
<target name="schema-export">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.EnversHibernateToolTask" classpathref="classpath"/>
<hibernatetool destdir="sql">
<classpath refid="classpath"/>
<jpaconfiguration persistenceunit="persistenceUnit"/>
<hbm2ddl export="false" create="true" drop="true" format="true" outputfilename="schema.sql"/>
</hibernatetool>
</target>
Same with this code: Only "basic", no "_aud" tables:
public static void main(String[] args) {
Ejb3Configuration jpaConfiguration = new Ejb3Configuration().configure("persistenceUnit", null);
Configuration hibernateConfiguration = jpaConfiguration.getHibernateConfiguration();
AuditConfiguration.getFor(hibernateConfiguration);
EnversSchemaGenerator esg = new EnversSchemaGenerator(hibernateConfiguration);
org.hibernate.tool.hbm2ddl.SchemaExport se = esg.export();
se.setOutputFile("sql/schema.sql");
se.setFormat(true);
se.setDelimiter(";");
se.drop(true, false);
se.create(true, false);
}
Are you still interested? I'll let you know if I find out how to solve the problem. Maybe somebody else has got any advice for us?