|
XDoclet2 for Hibernate3Since this is brand new XDoclet version and also new Hibernate version, I think this deserves a new page. First look at the old XDoclet for Hibernate [http://www.hibernate.org/72.html] page. The concept didn't change much (at least not for users). Helpful links:
Here is mine final working Ant script:
<project name="xdoclet2-plugin" default="xdoclet2">
<property name="xdoclet2.lib.dir" value="${user.home}/.maven/repository"/>
<target name="xdoclet2">
<mkdir dir="${basedir}/target/xdoclet2/persistence"/>
<path id="xdoclet2.task.classpath">
<!-- xdoclet2 -->
<pathelement location="${xdoclet2.lib.dir}/xdoclet/jars/xdoclet-SNAPSHOT.jar"/>
<!-- Add the xdoclet2 plugins jar here -->
<pathelement location="${xdoclet2.lib.dir}/xdoclet-plugins/jars/xdoclet-plugin-hibernate-1.0.jar"/>
<!-- xdoclet2 runtime dependencies -->
<pathelement location="${xdoclet2.lib.dir}/generama/jars/generama-1.1.jar"/>
<pathelement location="${xdoclet2.lib.dir}/picocontainer/jars/picocontainer-1.0.jar"/>
<pathelement location="${xdoclet2.lib.dir}/nanocontainer/jars/nanocontainer-1.0-beta-1.jar"/>
<pathelement location="${xdoclet2.lib.dir}/nanocontainer/jars/nanocontainer-ant-1.0-beta-1.jar"/>
<pathelement location="${xdoclet2.lib.dir}/qdox/jars/qdox-1.6-SNAPSHOT.jar"/>
<pathelement location="${xdoclet2.lib.dir}/velocity/jars/velocity-1.4-dev.jar"/>
<pathelement location="${xdoclet2.lib.dir}/commons-logging/jars/commons-logging-1.0.3.jar"/>
<pathelement location="${xdoclet2.lib.dir}/commons-collections/jars/commons-collections-2.1.jar"/>
<pathelement location="${xdoclet2.lib.dir}/commons-jelly/jars/commons-jelly-1.0-RC2-SNAPSHOT.jar"/>
<pathelement location="${xdoclet2.lib.dir}/commons-jelly/jars/commons-jelly-20030902.160215.jar"/>
<pathelement location="${xdoclet2.lib.dir}/commons-jelly/jars/commons-jelly-tags-define-1.0.jar"/>
<pathelement location="${xdoclet2.lib.dir}/commons-jelly/jars/commons-jelly-tags-antlr-20030211.143720.jar"/>
<pathelement location="${xdoclet2.lib.dir}/commons-jelly/jars/commons-jelly-tags-jsl-20030211.143151.jar"/>
<pathelement location="${xdoclet2.lib.dir}/commons-jelly/jars/commons-jelly-tags-log-20030211.142821.jar"/>
<pathelement location="${xdoclet2.lib.dir}/commons-jelly/jars/commons-jelly-tags-velocity-20030303.205659.jar"/>
<pathelement location="${xdoclet2.lib.dir}/commons-jelly/jars/commons-jelly-tags-xml-20040613.030723.jar"/>
<pathelement location="${xdoclet2.lib.dir}/log4j/jars/log4j-1.2.8.jar"/>
<pathelement location="${xdoclet2.lib.dir}/commons-logging/jars/commons-logging-1.0.4.jar"/>
<pathelement location="${xdoclet2.lib.dir}/dom4j/jars/dom4j-1.4-dev-8.jar"/>
<pathelement location="${xdoclet2.lib.dir}/commons-beanutils/jars/commons-beanutils-1.6.1.jar"/>
<pathelement location="${xdoclet2.lib.dir}/commons-jexl/jars/commons-jexl-1.0-beta-2.jar"/>
</path>
<taskdef
name="xdoclet2"
classname="org.xdoclet.ant.XDocletTask"
classpathref="xdoclet2.task.classpath"
/>
</target>
<target name="remove" depends="xdoclet2" >
<delete>
<fileset dir="${basedir}/src">
<include name="**/*.hbm.xml"/>
</fileset>
</delete>
</target>
<target name="hibernate" depends="remove">
<xdoclet2>
<!-- defines the file handled by xdoclet2 -->
<fileset dir="${basedir}/src">
<include name="**/*.java"/>
</fileset>
<!-- defines the processing of a plugin -->
<component
classname="org.xdoclet.plugin.hibernate.HibernateMappingPlugin"
destdir="${basedir}/src"
version="3.0"
/>
</xdoclet2>
</target>
</project>
Regarding dependency libraries. Pull the stuff down with Maven (that's how I did it, and it was my first time using Maven :-(, so it cannot be so hard :-). Follow this link for the missing jelly libs - http://jakarta.apache.org/commons/jelly/libs/. For any other info, I think wassup (see Hibernate forum) is your man. :-) Rgds, Ales
|
||||||||||||||||||||||||||||