【问题标题】:EnversHibernateToolTask in NetBean build file issueNetBean 构建文件中的 EnversHibernateToolTask​​ 问题
【发布时间】:2012-01-02 20:11:54
【问题描述】:

我正在尝试为 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>

问题是我得到了错误 taskdef 类 org.hibernate.tool.ant.EnversHibernateToolTask​​ 找不到 使用类加载器 AntClassLoader[myproject\lib\hibernate-persistence*.jar]

帮助会很大。

谢谢你, 伊多。

【问题讨论】:

    标签: netbeans ant hibernate-envers


    【解决方案1】:

    我怀疑你的路径不正确。我不相信你可以在 pathelement 中使用通配符。

    尝试将您的 path 更改为:

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

    如果失败,请使用-v 标签运行 ant 并检查调试以获取更多提示。

    【讨论】:

      猜你喜欢
      • 2012-01-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多