Hibernate version: 2.1.8
Ant Version: 1.6.2
I've been trying for a couple of days to get a SchemaExport to work, and no joy.
First, I tried using the command-line form, but the SchemaExport class uses getClass().getResourceAsStream(String) to read the configuration file and the mapping files, and for some reason I can't get it to see my configuration file even when I supply an absolute path (starting with a "/").
So then I tried with Ant, but Ant won't execute the SchemaExportTask task. It gives the following error...
Code:
C:\usr\Java\Projects\Collector>ant schemaexport
Buildfile: build.xml
BUILD FAILED
C:\usr\Java\Projects\Collector\build.xml:47: taskdef A class needed by class net.sf.hibernate.tool.hbm2ddl.SchemaExportTask cannot be found: org/apache/tools/ant/taskdefs/MatchingTask
The relevant portion of my build.xml looks like this...
Code:
<target name="schemaexport">
<taskdef name="schemaexport"
classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
classpathref="class.path"/>
<schemaexport
quiet="no"
text="no"
drop="no"
delimiter=";"
output="schema-export.sql">
<fileset dir="model">
include name="**/*.hbm.xml"/>
</fileset>
</schemaexport>
</target>
As a test, I wrote a Java class which extends Ant's MatchingTask, and it worked just fine. Then I tried to load an instance of SchemaExportTask and received a NoClassDefFoundError.
My classpath is almost absurdly simple, and I can't find any conflicts. I''ve searched this forum for similar problems and confirmed that the conditions which caused them don't hold in this instance.
So I'm stumped. Any help, anybody?
TIA,
Luke[/code]
Code: