title: Ecplipse ANT build error
body: <p>I'm new with ANT build, and I have a trouble with it, when I try to build I'm receiving a message:</p>
  
  <p>BUILD FAILED
  C:\Users\user\Documents\PM\proyecto-base\proyecto-base\intranet\build.xml:169: Reference xdoclet.classpath not found.</p>
  
  <p>but I have xdoclet.classpath declared already in the same file.</p>
  
  <p>Also I have the properties like ${xdoclet.lib.dir} declared in a build.properties file.</p>
  
  <p>here's my build.xml file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  
  &lt;!-- Ant Build File para Intranet --&gt;
  &lt;project name="${project.name}" default="ear" basedir="."&gt;
  
      &lt;!-- Importar funcionalidad comun --&gt;
      &lt;import file="../common.xml" /&gt;
      &lt;property name="jboss.security-domain" value="java:/jaas/NotificacionApplicationSecurity" /&gt;
      &lt;target name="init"&gt;        
          &lt;path id="classpath"&gt;
              &lt;fileset dir="${lib.dir}" /&gt;
              &lt;fileset dir="${hibernate.dir}" /&gt;
              &lt;fileset dir="${hibernate-annotations.dir}" /&gt;
              &lt;fileset dir="${sri-adm.dir}" /&gt;
              &lt;fileset dir="${sri-seguridad.dir}" /&gt;
              &lt;fileset dir="${jsf.dir}" /&gt;
              &lt;fileset file="${servicio.jar}" /&gt;
              &lt;fileset file="${log4j.jar}" /&gt;
              &lt;fileset file="${servlet.jar}" /&gt;
              &lt;fileset file="${mail.jar}" /&gt;
              &lt;fileset dir="${jboss.lib}"&gt;
                  &lt;include name="*.jar" /&gt;
              &lt;/fileset&gt;
          &lt;/path&gt;
          &lt;path id="xdoclet.classpath"&gt;
              &lt;fileset dir="${xdoclet.lib.dir}" /&gt;
              &lt;pathelement location="${j2ee.jar}" /&gt;
              &lt;pathelement location="${servlet.jar}" /&gt;
          &lt;/path&gt;
      &lt;/target&gt;
  
      &lt;target name="clean" depends="init"&gt;
          &lt;delete dir="../${build.dir}/intranet" /&gt;
          &lt;delete dir="../${dist.dir}"&gt;
              &lt;exclude name="${servicio.name}-${version}.jar"/&gt;
          &lt;/delete&gt;
      &lt;/target&gt;
  
  
      &lt;!--=============== Compile JAVA files ========================--&gt;
      &lt;target name="compile" description="Compile" &gt;
          &lt;echo message="Start compilation..." /&gt;
          &lt;!-- compile project--&gt;
          &lt;mkdir dir="../${build.intranet.dir}/classes"/&gt;
          &lt;javac destdir="../${build.intranet.dir}/classes" target="1.5" debug="true" deprecation="false" optimize="false" failonerror="true"&gt;
              &lt;src path="${src.main.java.dir}" /&gt;
              &lt;classpath refid="classpath" /&gt;
          &lt;/javac&gt;
      &lt;/target&gt;
  
      &lt;!--============== Genera archivos web==========--&gt;
      &lt;target name="webdoclet" description="Generar archivos XML Web y Struts" &gt;
          &lt;echo message="Generando Web" /&gt;
          &lt;delete file="../${metadata.intranet.web.dir}/jboss-web.xml"/&gt;
              &lt;webdoclet destdir="../${metadata.intranet.web.dir}" force="${xdoclet.force}" mergedir="${conf.xdoclet.intranet.dir}"&gt;
                  &lt;fileset dir="${src.main.java.dir}"&gt;
                      &lt;include name="**/*.java" /&gt;
                  &lt;/fileset&gt;
                  &lt;deploymentdescriptor displayname="SRI" description="" xmlencoding="ISO-8859-1" 
                      validatexml="true" servletspec="2.4" sessiontimeout="60" destdir="../${metadata.intranet.web.dir}" 
                      mergeDir="../${conf.xdoclet.intranet.dir}" distributable="false" /&gt;
  
                  &lt;facesconfigxml destinationfile="${project.name}-faces-config.xml" mergedir="../${metadata.intranet-jsf}" /&gt;
                  &lt;jbosswebxml
                      version="4.0"
                      mergeDir="${metadata.intranet-jbossweb}"
                      contextroot="${project.name}"
                      securitydomain="${jboss.security-domain}"
                      validateXML="true" xmlencoding="ISO-8859-1"/&gt;
              &lt;/webdoclet&gt;
              &lt;replace file="../${metadata.intranet.web.dir}/jboss-web.xml" token="&amp;lt;security-domain" value="&amp;lt;security-domain flushOnSessionInvalidation=&amp;quot;true&amp;quot;" /&gt;        
  
      &lt;/target&gt;
  
  
  
      &lt;target name="build" depends="init,webdoclet" description="Compila las clases"&gt;
          &lt;mkdir dir="../${classes.dir}" /&gt;
          &lt;javac destdir="../${classes.dir}" debug="on" deprecation="on" optimize="off" target="1.5" encoding="ISO-8859-1"&gt;
              &lt;src path="${src.main.java.dir}" /&gt;
              &lt;classpath refid="classpath" /&gt;
              &lt;classpath refid="xdoclet.classpath" /&gt;
  
              &lt;!-- Descomentar si se quieren ver los Warnings --&gt;
              &lt;!--compilerarg value="-Xlint:unchecked" /--&gt;
          &lt;/javac&gt;
      &lt;/target&gt;
  
      &lt;!--=============  Genera un archivo WAR del proyecto =============================--&gt;
  
      &lt;target name="war" description="Packages app as WAR" depends="compile, webdoclet"&gt;
          &lt;echo message="Generando WAR..." /&gt;
          &lt;mkdir dir="../${dist.dir}/intranet" /&gt;
          &lt;copy todir="../${metadata.tmp.intranet.dir}"&gt;
              &lt;fileset dir="../${metadata.intranet.web.dir}" /&gt;
              &lt;filterset&gt;
                  &lt;filter token="project.name" value="${project.name}"/&gt;
              &lt;/filterset&gt;
          &lt;/copy&gt;
          &lt;copy file="../${conf.intranet.dir}/jboss-web.xml" todir="../${metadata.tmp.intranet.dir}"&gt;
              &lt;filterset&gt;
                  &lt;filter token="project.name" value="${project.name}"/&gt;
              &lt;/filterset&gt;
          &lt;/copy&gt; 
  
          &lt;war destfile="../${dist.dir}/intranet/${webapp.intranet.name}.war" webxml="../${metadata.intranet.web.dir}/web.xml"&gt;
              &lt;classes dir="../${build.intranet.dir}/classes"&gt;
                  &lt;include name="**/**/controladores/*.*"/&gt;
                  &lt;include name="**/**/web/**/*.*"/&gt;
                  &lt;include name="**/**/validadores/**/*.*"/&gt;
                  &lt;include name="**/**/convertidores/**/*.*"/&gt;
                  &lt;exclude name="**/**/internet/**/*.*"/&gt;
              &lt;/classes&gt;
              &lt;classes dir="../intranet/src/main/java"&gt;
                  &lt;include name="**/**/*.properties"/&gt;
              &lt;/classes&gt;
              &lt;fileset dir="${src.main.webapp.dir}"&gt;
                  &lt;include name="**/*.*" /&gt;
              &lt;/fileset&gt;
  
              &lt;lib dir="${jsf.dir}" &gt;
                  &lt;include name="rich*.jar" /&gt;
                  &lt;include name="jsf*facelet*.jar" /&gt;
              &lt;/lib&gt;
              &lt;lib dir="${sri-seguridad.dir}" &gt;
                  &lt;include name="seguridad*.jar" /&gt;
              &lt;/lib&gt;
  
  
              &lt;lib dir="${lib.dir}" &gt;
                  &lt;include name="commons-digester.jar" /&gt;
                  &lt;include name="commons-beanutils.jar" /&gt;
                  &lt;include name="commons-fileupload.jar" /&gt;
                  &lt;include name="commons-el.jar" /&gt;
                  &lt;include name="commons-lang-2.1.jar" /&gt;
              &lt;/lib&gt;
  
              &lt;!-- Archivos de configuracion en WEB-INF --&gt;
              &lt;webinf file="../${metadata.tmp.intranet.dir}/web.xml" /&gt;
              &lt;webinf file="../${metadata.tmp.intranet.dir}/${project.name}-faces-config.xml" /&gt;
              &lt;webinf file="../${metadata.tmp.intranet.dir}/jboss-web.xml" /&gt;
          &lt;/war&gt;
          &lt;delete dir="../${metadata.tmp.intranet.dir}" /&gt;
      &lt;/target&gt;
  
      &lt;target name="ear" depends="war"&gt;
          &lt;mkdir dir="../${metadata.intranet-ejb.tmp}" /&gt;
          &lt;copy todir="../${metadata.intranet-ejb.tmp}"&gt;
              &lt;fileset dir="../${metadata.intranet-ejb}" /&gt;
              &lt;filterset&gt;
                  &lt;filter token="project.name" value="${project.name}"/&gt;
                  &lt;filter token="intranet.name" value="${intranet.name}"/&gt;
              &lt;/filterset&gt;
          &lt;/copy&gt; 
          &lt;ear destfile="../${dist.dir}/intranet/${webapp.intranet.name}.ear" appxml="../${metadata.intranet-ejb.tmp}/application.xml"&gt;
              &lt;fileset dir="../${dist.dir}" includes="*.jar"/&gt;
              &lt;fileset dir="../${dist.dir}/intranet" includes="*.war"/&gt;
  
          &lt;/ear&gt;
          &lt;delete dir="../${metadata.intranet-ejb.tmp}" /&gt;
      &lt;/target&gt;
  
  
      &lt;target name="deploy" depends="ear" description="Copia el archivo WAR en el directorio deploy del server"&gt;
          &lt;copy file="../${dist.dir}/intranet/${webapp.intranet.name}.ear" todir="${jboss.deploy.intranet.dir}" /&gt;
      &lt;/target&gt;
  
      &lt;!-- Definición de WebDoclet --&gt;
      &lt;taskdef name="webdoclet" classname="xdoclet.modules.web.WebDocletTask"&gt;
          &lt;classpath&gt;
              &lt;path refid="xdoclet.classpath" /&gt;
              &lt;path refid="classpath" /&gt;
          &lt;/classpath&gt;
      &lt;/taskdef&gt;
  
  
  
      &lt;!-- Definicion de JSF --&gt;
  
      &lt;taskdef name="facesconfigxml" classname="xdoclet.modules.jsf.FacesConfigXmlSubTask"&gt;
          &lt;classpath&gt;
              &lt;path refid="xdoclet.classpath" /&gt;
              &lt;path refid="classpath" /&gt;
          &lt;/classpath&gt;
      &lt;/taskdef&gt;  
  &lt;/project&gt;
  </code></pre>
  
  <p>the lines which are returning me the error are the following:</p>
  
  <pre><code>&lt;!-- Definición de WebDoclet --&gt;
  &lt;taskdef name="webdoclet" classname="xdoclet.modules.web.WebDocletTask"&gt;
      &lt;classpath&gt;
          &lt;path refid="xdoclet.classpath" /&gt;
          &lt;path refid="classpath" /&gt;
      &lt;/classpath&gt;
  &lt;/taskdef&gt;
  </code></pre>
  
  <p>but as I told you I have already declared my xdoclet.classpath in the same file at the begining:</p>
  
  <pre><code> &lt;path id="xdoclet.classpath"&gt;
              &lt;fileset dir="${xdoclet.lib.dir}" /&gt;
              &lt;pathelement location="${j2ee.jar}" /&gt;
              &lt;pathelement location="${servlet.jar}" /&gt;
          &lt;/path&gt;
  </code></pre>
  
  <p>Can Anyone help me with this Issue please? thanks a lot</p>