Struts + XDoclet (webdoclet) and integration with Eclipse

XDoclet (webdoclet) and Ant

Running XDoclet from Ant is clearly described in XDoclet in Action by Craig Walls and Norman Richards. They invoke the “generate-web” target from the main build.xml with <ant antfile="build-webgen.xml" target="generate-web" />, hence the relevant code is found in their build-webgen.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<project name="Blog" default="generateWeb" basedir=".">
<path id="xdoclet.lib.path">
	<fileset dir="${lib.dir}" includes="*.jar"/>
	<fileset dir="${xdoclet.lib.dir}" includes="*.jar"/>
</path>
<target name="generate-web">
  <taskdef name="webdoclet"
           classname="xdoclet.modules.web.WebDocletTask"
           classpathref="xdoclet.lib.path"/>
  <!-- Generate servlet and JSP Tag "stuff" -->
  <webdoclet destdir="${gen.src.dir}" mergeDir="${merge.dir}">
    <fileset dir="${src.dir}">
      <include name="**/*Servlet.java" />
      <include name="**/*Filter.java" />
      <include name="**/*Listener.java" />
      <include name="**/*Tag.java" />
      <include name="**/*Action.java" />
      <include name="**/*Form.java" />
    </fileset>
    <fileset dir="${gen.src.dir}">
      <include name="**/*Form.java" />
    </fileset>
    <deploymentdescriptor
      destdir="${web.deployment.dir}"
      distributable="false" />
    <jsptaglib
      filename="blogtags.tld"
      shortname="dateformat"
      destDir="${web.deployment.dir}" />
    <strutsconfigxml
      version="1.1"
      destDir="${web.deployment.dir}" />
    <strutsvalidationxml
      destDir="${web.deployment.dir}" />
  </webdoclet>
</target>
</project>

2 Comments

  1. viralpatel December 9, 2008
  2. Pingback: Credit Report Offers April 26, 2007
  3. Pingback: Tripods For Less April 24, 2007
  4. Pingback: Debt Consultation April 22, 2007
  5. Nagendra April 19, 2006