刚刚开始看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.xmlxdoclet:
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然后什么也没有生成。各位看看有没有遇到过类似问题,是什么原因引起的呢?
<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.xmlxdoclet:
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然后什么也没有生成。各位看看有没有遇到过类似问题,是什么原因引起的呢?
</fileset>
有可能是没有找到java文件,指定包 试试
to,scueczhang:
你那个是从网上某个地方抄过来的吧。能否指点一下我可能错误的位置。我看不出来你抄过来的那一段和我自己设置的那一段有什么本质的区别。谢谢
http://www.nabble.com/Target-%22%C3%BBf%22-does-not-exist-in-the-project-%22null%22.-td22181547.html
* @hibernate.class table="servers"
* @hibernate.mate attribute="class-description" value="记录服务器的配置信息"
* @author sliverFly
* @see xdoclet
*/
public class Servers implements Serializable {
/**
*
*/
private static final long serialVersionUID = 7269795515944922978L;
private String serverName;
private String host;
private String db;
private String username;
private String password;
private Integer port;
private String socket;
private String wrapper;
private String owner;
/**
* @hibernate.id generator-class="assigned"
* @return the serverName
*/
public String getServerName() {
return serverName;
}
/**
* @hibernate.property column="host"
* @return the host
*/
public String getHost() {
return host;
}
http://topic.csdn.net/u/20091010/15/c9a70b81-9566-4610-9724-59d64f895da8.html