I used to instrument my classes in Hibernate 4.x with an ant target:
<target name="instrument" depends="compile">
<taskdef name="enhance" classname="org.hibernate.tool.enhance.EnhancementTask">
<classpath refid="extended.classpath"/>
<classpath path="${classbin.dir}"/>
</taskdef>
<instrument verbose="true">
<fileset dir="${TARGETROOT}/home/WEB-INF/classes">
<include name="org/zfin/publication/Publication.class"/>
</fileset>
</instrument>
</target>
But this stopped working when I upgraded to Hibernate 5.3.7. What is the proper way to do this in ant? Note, I do not use Maven.
I tried this change
<target name="instrument" depends="compile">
<taskdef name="enhance" classname="org.hibernate.tool.enhance.EnhancementTask">
<classpath refid="extended.classpath"/>
<classpath path="${classbin.dir}"/>
</taskdef>
<enhance base="${classbin.dir}" dir="${classbin.dir}/org/zfin/publication" failOnError="false" enableLazyInitialization="true"
enableDirtyTracking="false"
enableAssociationManagement="false"
enableExtendedEnhancement="false">
</enhance>
</target>
but it outputed [enhance] Unable to enhance class: Publication.class
indicating that it is not working. It enhanced some classes in that directory but not the one I needed.