I'm having trouble using the annotationsconfiguration and hbm2ddl in ant as well. The relevant target is below. If I put export="no" then the ddl prints to the console as expected and saves to my output file. If I start the database and put export="yes", however, the target succeeds, but does nothing. The database is not changed, and neither the console nor the outputfile receives anything.
The database log does print the following each time I run schemaexport with export="yes":
[db.log]:
[java] [Server@a62fc3]: [Thread[HSQLDB Server @a62fc3,6,main]]: handleConnection(Socket[addr=/127.0.0.1,port=1030,localport=9001]) entered
[java] [Server@a62fc3]: [Thread[HSQLDB Server @a62fc3,6,main]]: handleConnection() exited
[java] [Server@a62fc3]: [Thread[HSQLDB Server @a62fc3,6,main]]: handleConnection(Socket[addr=/127.0.0.1,port=1031,localport=9001]) entered
[java] [Server@a62fc3]: [Thread[HSQLDB Server @a62fc3,6,main]]: handleConnection() exited
[build.xml]:
...
Code:
<target name="schemaexport" depends="compile"
description="Generates the database schema.">
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask">
<classpath>
<path refid="hibernate.tools.classpath" />
<path refid="run.classpath" />
</classpath>
</taskdef>
<hibernatetool>
<classpath>
<path location="${build.classes.dir}" />
<path refid="run.classpath" />
</classpath>
<annotationconfiguration
configurationfile="${build.classes.dir}/resources/hibernate.cfg.xml" />
<hbm2ddl destdir="${build.dir}/WEB-INF/conf"
outputfilename="sandbox.ddl"
export="no" console="yes" create="yes" drop="yes"
delimiter=";" />
</hibernatetool>
</target>
Any thoughts?
Thanks,
-J