xdoclet生成hibernate映射文件的问题
说好不能打脸 Java领域优质创作者 博客专家认证 2009-10-15 12:17:43 刚刚开始看xdoclet,不知道是不是写xml文件的时候出来错。大家看看,我只贴出生成映射文件的那一段。
<property name="xdoclet.lib.dir" value="${basedir}/WebRoot/WEB-INF/lib/xdoclet" />
<property name="project.lib.dir" value="${basedir}/WebRoot/WEB-INF/lib" />
<property name="project.src.dir" value="${basedir}/src" />
<property name="project.resources.dir" value="${basedir}/doc/dbscript" />
<target name="xdoclet">
<taskdef name="hibernatedoclet" classname="org.xdoclet.ant.XDocletTask" classpathref="xdoclet.task.classpath" />
<path id="xdoclet.task.classpath">
<fileset dir="${xdoclet.lib.dir}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${project.lib.dir}">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${xdoclet.plugin.install.dir}/plugins/xdoclet-plugin-command.jar"/>
</path>
<!-- 生成映射文件的ant配置 -->
<target name="generate-mapping" depends="xdoclet">
<xdoclet>
<fileset dir="${project.src.dir}">
<include name="**/*.java" />
</fileset>
<component classname="org.xdoclet.plugin.hibernate.HibernateMappingPlugin" version="3.0" destdir="${project.src.dir}"/>
</xdoclet>
</target>
执行的效果是:
Buildfile: build.xml
xdoclet:
Warning: Reference xdoclet.task.classpath has not been set at runtime, but was f
ound during
build file parsing, attempting to resolve. Future versions of Ant may support
referencing ids defined in non-executed targets.
BUILD SUCCESSFUL
Total time: 0 seconds
然后什么也没有生成。
各位看看有没有遇到过类似问题,是什么原因引起的呢?