I'm not sure if the order of the tasks does have an impact, but
<hbm2java />
<hbm2hbmxml/>
seem to be the wrong way arround -> first u generate the hbm's and then the code.
Also I'm using seperate steps:
like:
....
Code:
<target name="ddl2hbm" depends="init" >
<hibernatetool destdir="${build.dir}/generated">
<jdbcconfiguration
configurationfile="hibernate.cfg.xml"
packagename="xx.xxx.xxx.db"
revengfile="hibernate.reveng.xml"
>
</jdbcconfiguration>
<hbm2hbmxml/>
</hibernatetool>
</target>
.... then this to generate the hibernate config holding the correct hbm references:
Code:
<target name="hbm2config">
<hibernatetool destdir="${build.dir}/generated">
<configuration configurationfile="hibernate.cfg.xml">
<fileset dir="${build.dir}/generated">
<include name="**/MASTER_*.hbm.xml"/>
<exclude name="**/*Test*"/>
</fileset>
</configuration>
<hbm2cfgxml destdir="${build.dir}"/>
</hibernatetool>
</target>
.... and the code generation
Code:
<target name="hbm2java" depends="hbm2config">
<hibernatetool destdir="${build.dir}/src" >
<configuration configurationfile="${build.dir}/hibernate.cfg.xml">
<!-- use the generated one !!! -->
</configuration>
<hbm2java jdk5="true" ejb3="false"/>
</hibernatetool>
</target>