hmm, did anyone have luck with this? I had ant 1.5 and got the "SchemaExport cannot be found" error also. After upgrading to ant 1.6 to see if that was the problem, the error message was more descriptive, saying:
C:\jdeveloper\jdev\mywork\Hibernate\build.xml:41: taskdef A class needed by class net.sf.hibernate.tool.hbm2ddl.SchemaExportTask cannot be found: org/apache/tools/ant/taskdefs/MatchingTask
So it can't find org.apache.tools.ant.taskdefs.MatchingTask
This, however, is in c:\ant\lib\ant.jar. So as a dirty/quick fix, I just tried to test it by throwing ant.jar into my project's lib directory, as it was already in the classpath. No luck. I then tried specifying:
<taskdef name="schemaexport"
classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask">
<classpath refid="classpath"/>
<classpath>
<pathelement path="C:\ant\lib\ant.jar"/>
</classpath>
<classpath path="${compile.outdir}"/>
</taskdef>
And I also tried calling MatchingTask also, to see if I'd get errors.
<taskdef name="matching"
classname="org.apache.tools.ant.taskdefs.MatchingTask">
<classpath refid="classpath"/>
<classpath path="${compile.outdir}"/>
</taskdef>
When I comment out the "schemaexport" section, I don't get errors, leading me to believe that it can find MatchingTask. Once I uncomment that "schemaexport" code block however, it gives me the error, saying it can't find MatchingTask! How frustrating! Any help for a beginner please? :( This is delaying me for hours and I so want to play with Hibernate! Thank you very much!
|