Thanks sameet for your response.
"classpathref" and "classpath" attributes of the <taskdef> task are intended to tell Ant where to find the class specified in the "classname" attribute. In otherwords, tells Ant where to find "net.sf.hibernate.tool.hbm2java.Hbm2JavaTask".
Where Hbm2JavaTask is located is totally unrelated to where my classes for UserTypes are located. The "hbm2java" task that is being defined, itself has "classpath" attribute and supports nested <classpath> specification. It is these classpath parameters to the <hbm2java> task that do nothing while it is implied that the task would use these parameters to do its work.
Code:
<hbm2java output="${basedir}" >
<classpath>
<pathelement location="${classes.dir}"/>
<fileset refid="all.lib" />
</classpath>
<fileset dir="${basedir}" includes="*.hbm.xml" />
</hbm2java>
In the example above, ${classes.dir} is where my UserTypes are compiled to.
Hopefully this clarifies the issue.