2012-01-02 50 views
0

我正在嘗試爲Envers集成hibernate架構生成器。 我已經加入這個目標:NetBeans中的EnversHibernateToolTask​​構建文件問題

<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 \休眠得到錯誤 的taskdef類org.hibernate.tool.ant.EnversHibernateToolTask​​無法找到 -persistence * .jar]

幫助會很好。

謝謝, 伊多。

回答

0

我懷疑你的路徑不正確。我不相信你可以在pathelement中使用通配符。

試着改變你的path是:

<path id="hibernate.classpath"> 
    <fileset dir="lib"> 
     <include name="**/*.jar"/> 
    </fileset> 
</path> 

如果失敗,運行ant與-v標記,並檢查調試更多的提示。