我正在尝试为 Envers 合并休眠模式生成器。我添加了这个目标:
<target name="schemaexport"
description="Exports a generated schema to DB and file">
<path id="hibernate.classpath">
<pathelement path="./lib/hibernate-persistence/*.jar" />
</path>
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.EnversHibernateToolTask"
classpathref="hibernate.classpath"/>
<hibernatetool destdir=".">
<classpath>
<fileset refid="lib.hibernate" />
<path location="${build.demo.dir}" />
<path location="${build.main.dir}" />
</classpath>
<jpaconfiguration persistenceunit="AuroraServicePU" />
<hbm2ddl
drop="false"
create="true"
export="false"
outputfilename="versioning-ddl.sql"
delimiter=";"
format="true"/>
</hibernatetool>
</target>
问题是我 使用类加载器 AntClassLoader[myproject\lib\hibernate-persistence*.jar] 得到错误 taskdef class org.hibernate.tool.ant.EnversHibernateToolTask
帮助会很大。
谢谢你,伊多。