AnsweredAssumed Answered

Error con Ant cuando lanzo build.xml

Question asked by durdy48 on Dec 7, 2007
Hola.
Y gracias a todos por la colaboracion.

Porque obtengo este error cuando lanzo build.xml??



clean-webserviceclient:
   [delete] Deleting directory C:\Documents and Settings\dra002\workspaceAlfresco\HEAD\root\projects\web-service-client\build\classes
clean:
compile-core:
    [mkdir] Created dir: C:\Documents and Settings\dra002\workspaceAlfresco\HEAD\root\projects\core\build\classes
    [javac] Compiling 83 source files to C:\Documents and Settings\dra002\workspaceAlfresco\HEAD\root\projects\core\build\classes

BUILD FAILED
C:\Documents and Settings\dra002\workspaceAlfresco\HEAD\root\projects.xml:30: The following error occurred while executing this line:
C:\Documents and Settings\dra002\workspaceAlfresco\HEAD\root\macros.xml:24: Error running javac.exe compiler

Total time: 23 seconds

Tengo estos proyectos importados en Eclipse:
    3rdParty
    Core
    Deployment
    MBean
    Repository
Y mi archivo build.xml es el que tiene "HEAD\root\build.xml":

<project name="alfresco"
         default="build-tomcat" >


   <!– ****************************************************** –>
   <!– ************ Initialisation/Configuration ************ –>
   <!– ****************************************************** –>

   <import file="macros.xml" />
   <import file="projects.xml" />

   <target name="init">
      <property environment="env" />

      <!–
            On UNIX, it's considered very poor form to dump a config file that
            does not start with "." into the user's $HOME directory. 

            On Windows, it's a bit more debatable, but in any event Alfresco
            config files should always start with "alfresco-…", so the current
            prop file convention needs to be fixed no matter how you slice it. 
            The conditional below is intended to make the transition more graceful
            until we re-work the build. 
      –>
      <condition property = "alfresco.user.override.properties.file"
                 value    = "${user.home}/.alfresco-user-override.properties"
                 else     = "${user.home}/user-override.properties">
          <available file = "${user.home}/.alfresco-user-override.properties"/>
      </condition>
      <property file      = "${alfresco.user.override.properties.file}" />

      <property file="${basedir}/projects/repository/config/alfresco/version.properties" />
      <property file="${basedir}/build.properties" />
      <property file="${basedir}/shared.properties" />

      <path id="classpath.compile">
         <fileset dir="${dir.project.3rdparty.lib}">
            <include name="**/*.jar" />
         </fileset>
         <fileset dir="${dir.projects}">
            <include name="**/${dir.name.build}/${dir.name.dist}/*.jar" />
         </fileset>
         <fileset dir="${dir.modules}">
            <include name="**/${dir.name.lib}/*.jar" />
         </fileset>
      </path>

      <path id="classpath.unit.test">
         <dirset dir="${dir.projects}">
            <include name="**/${dir.name.build}/${dir.name.classes}" />
         </dirset>
         <pathelement location="${user.home}"/>
         <pathelement location="${dir.project.repository.config}"/>
         <pathelement location="${dir.project.webclient.config}"/>
         <pathelement location="${dir.project.deployment.config}"/>
         <dirset dir="${dir.projects}">
            <include name="**/${dir.name.source}/${dir.name.test.resources}" />
         </dirset>
         <fileset dir="${dir.project.3rdparty.lib}">
            <include name="**/*.jar" />
         </fileset>
      </path>

      <path id="classpath.javadoc">
         <path refid="classpath.compile"/>
      </path>

      <patternset id="files.tests">
         <exclude name="**/Base*Test.java" />
         <exclude name="**/Abstract*Test.java" />
         <exclude name="**/*SystemTest.java" />
         <!– Action Tests –>
         <exclude name="**/org/alfresco/repo/action/**/*Test.java" />
         <include name="**/org/alfresco/repo/action/ActionTestSuite.java" />
         <!– Content Tests –>
         <exclude name="**/org/alfresco/repo/content/**/*Test.java" />
         <include name="**/org/alfresco/repo/content/ContentTestSuite.java" />
         <include name="**/org/alfresco/repo/content/metadata/xml/XmlMetadataExtracterTest.java" />
         <!– Multilingual Tests –>
         <exclude name="**/org/alfresco/repo/model/ml/**/*Test.java" />
         <include name="**/org/alfresco/repo/model/ml/MultilingualTestSuite.java" />
         <!– FileFolder Tests –>
         <exclude name="**/org/alfresco/repo/model/filefolder/**/*Test.java" />
         <include name="**/org/alfresco/repo/model/filefolder/FileFolderTestSuite.java" />
         <!– All other tests –>
         <include name="**/*Test.java" />
         <!– include the updated indexer tests –>
         <include name="**/LuceneCategoryTest2.java" />
<!–
         <include name="**/LuceneTest2.java" />
–>
      </patternset>
   </target>



   <!– ****************************************************** –>
   <!– ***************** Entry point targets **************** –>
   <!– ****************************************************** –>

   <target name="build"
           description="Performs a clean build of all projects"
           depends="clean,
                    incremental" />

   <target name="incremental"
           description="Performs an incremental build of all projects"
           depends="-tomcat" />

   <target name="build-tomcat"
           description="Performs a clean build for Tomcat and deploys the WAR file"
           depends="clean,
                    incremental-tomcat" />
                   
   <target name="build-tomcat-exploded"
           depends="clean,
                    clean-tomcat-deploy,
                    incremental-tomcat-exploded" />

   <target name="incremental-tomcat"
           description="Performs an incremental build for Tomcat and deploys the WAR file"
           depends="-tomcat,
                    deploy-tomcat" />
  
   <target name="incremental-tomcat-exploded"
           depends="incremental-core,
                    incremental-mbeans,
                    incremental-deployment,
                    incremental-repository,
                    incremental-remoteapi,
                    incremental-jndi,
                    incremental-catalinavirtual,
                    incremental-linkvalidation,
                    incremental-webframework,
                    package-webclient-jar,
                    deploy-tomcat-exploded" />
  
   <target name="build-jboss"
           description="Performs a clean build for JBoss and deploys the WAR file"
           depends="clean,
                    incremental-jboss" />

   <target name="incremental-jboss"
           description="Performs an incremental build for JBoss and deploys the WAR file"
           depends="package-webclient-war-jboss,
                    deploy-jboss" />

   <target name="generate-docs"
           description="Compiles all documentation for all projects"
           depends="generate-javadocs-core,
                    generate-javadocs-mbeans,
                    generate-javadocs-deployment,
                    generate-javadocs-repository,
                    generate-javadocs-remoteapi,
                    generate-javadocs-jndi,
                    generate-javadocs-catalinavirtual,
                    generate-javadocs-linkvalidation,
                    generate-javadocs-webclient,
                    generate-taglibdocs-webclient,
                    generate-javadocs-webserviceclient" />

   <target name="-tomcat"
           depends="incremental-core,
                    incremental-mbeans,
                    incremental-deployment,
                    incremental-repository,
                    incremental-remoteapi,
                    incremental-jndi,
                    incremental-catalinavirtual,
                    incremental-linkvalidation,
                    incremental-webframework,
                    incremental-webclient, 
                    incremental-webserviceclient" />



   <!– ****************************************************** –>
   <!– ****************** Cleaning targets ****************** –>
   <!– ****************************************************** –>

   <target name="clean"
           description="Cleans everything"
           depends="clean-core,
                    clean-mbeans,
                    clean-deployment,
                    clean-repository,
                    clean-remoteapi,
                    clean-jndi,
                    clean-catalinavirtual,
                    clean-linkvalidation,
                    clean-webframework,
                    clean-webclient,
                    clean-rm,
                    clean-blog,
                    clean-php,
                    clean-fb-doclib,
                    clean-webserviceclient" />

   <target name="clean-tomcat-deploy"
           description="Cleans the Alfresco application from Tomcat"
           depends="init">
      <delete file="${dir.deploy.tomcat}/${file.name.war.webclient}" />
      <delete dir="${dir.deploy.tomcat}/alfresco"
              includeEmptyDirs="true"
              quiet="yes" />
   </target>

   <target name="clean-virtual-tomcat-deploy"
           description="Cleans the Virtual Tomcat deployment"
           depends="init">
       <delete failonerror="no">
           <!– Remove old spring jar files lingering in common/lib, if any –>
           <fileset dir="${home.virtualtomcat}/common/lib" includes="spring*.jar"/>

           <!– Get rid of old config files –>
           <fileset dir="${home.virtualtomcat}/conf" includes="alfresco-*"/>
       </delete>
   </target>
  
   <target name="clean-jboss-deploy"
           description="Cleans the Alfresco application from JBoss"
           depends="init">
      <delete file="${dir.deploy.jboss}/${file.name.war.webclient}" />
   </target>

   <target name="clean-war"
           description="Cleans just the WAR file"
           depends="init">
      <delete file="${dir.project.webclient.dist}/${file.name.war.webclient}" />
      <delete quiet="yes"
              includeEmptyDirs="true"
              dir="${dir.project.webclient.assemble}" />
   </target>



   <!– ****************************************************** –>
   <!– **************** Deployment targets ****************** –>
   <!– ****************************************************** –>
  
   <target name="-deploy-tomcat-common" depends="init">

      <!– ensure mysql drivers and xalan files are present –>
      <delete>
         <fileset dir="${home.tomcat}/common/lib"
                  includes="mysql-connector*"
                  excludes="${file.name.jar.mysql.connector}" />
      </delete>

      <copy todir="${home.tomcat}/common/lib"     
            file="${dir.project.3rdparty.lib}/${dir.name.devenv}/${file.name.jar.mysql.connector}" />

      <copy todir="${home.tomcat}/common/endorsed"
            file="${dir.project.3rdparty.lib}/${dir.name.xalan}/${file.name.jar.xalan}" />

      <copy todir="${home.tomcat}/common/endorsed"
            file="${dir.project.3rdparty.lib}/${dir.name.xalan}/${file.name.jar.serializer}" />

      <!– copy the hotspot_compiler file to bin directory –>
      <copy todir="${home.tomcat}/bin"
            file="${file.hotspotcompiler}" />

      <!– enable WCM functionality –>
      <copy todir="${home.tomcat}/shared/classes/alfresco/extension"
            file="${dir.project.installer}/wcm-bootstrap-context.xml" />
   </target>
  
   <target name="deploy-tomcat"
           description="Deploys to Tomcat"
           depends="clean-tomcat-deploy, -deploy-tomcat-common, deploy-virtual-tomcat">

      <!– copy the webclient WAR file to Tomcat's deploy folder –>
      <copy todir="${dir.deploy.tomcat}"
            file="${dir.project.webclient.dist}/${file.name.war.webclient}" />
   </target>

   <target name="deploy-tomcat-exploded"
           depends="-deploy-tomcat-common">
     
      <!– copy the class files from each project to the WEB-INF/classes folder –>
      <copy todir="${dir.deploy.tomcat}/alfresco/WEB-INF/classes" verbose="${copy.verbose}">
     
         <!– copy class files –>
         <fileset dir="${dir.project.core.classes}" />
         <fileset dir="${dir.project.mbeans.classes}" />
         <fileset dir="${dir.project.deployment.classes}" />
         <fileset dir="${dir.project.repository.classes}"
                  excludes="**/extension/**" />
         <fileset dir="${dir.project.remoteapi.classes}" />
         <fileset dir="${dir.project.catalinavirtual.classes}" />
         <fileset dir="${dir.project.linkvalidation.classes}" />
         <fileset dir="${dir.project.webframework.classes}" />
         <fileset dir="${dir.project.webclient.classes}"
                  excludes="**/extension/**" />
       
         <!– copy config files –>
         <fileset dir="${dir.project.core.src.java}"
                  includes="log4j.properties" />
         <fileset dir="${dir.project.repository.config}"
                  excludes="**/extension/**" />
         <fileset dir="${dir.project.webclient.config}"
                  excludes="**/extension/**" />
         <!– NOTE: include dev-context.xml to allow developer overrides –>
         <fileset dir="${dir.project.repository.config}"
                  includes="**/extension/dev-context.xml"/>
      </copy>

      <!–
           Temporary measure to help Eclipse users deal with
           link validation dependencies.  This should be cleaned
           up when the build is transformed into a single project.
      –>
      <copy file="${dir.project.linkvalidation.config}/alfresco/alfresco-link-validation-bootstrap-context.xml"
            todir="${dir.deploy.tomcat}/alfresco/WEB-INF/classes/alfresco/extension"/>


      <!– copy webclient web source files i.e. JSPs, images etc. –>
      <copy todir="${dir.deploy.tomcat}/alfresco" verbose="${copy.verbose}">
         <fileset dir="${dir.project.webclient.src.web}"
                  excludes="WEB-INF/jboss*.xml, WEB-INF/portlet*.xml,
                            WEB-INF/alfresco-object.xml" />
      </copy>
     
      <!– copy required 3rd party libs –>
      <copy todir="${dir.deploy.tomcat}/alfresco/WEB-INF/lib" verbose="${copy.verbose}">
         <fileset dir="${dir.project.3rdparty.lib}" includes="*.jar"
                  excludes="${dir.name.devenv}/**" />
         <fileset dir="${dir.project.3rdparty.lib}/jibx" includes="*.jar" />
         <fileset dir="${dir.project.3rdparty.lib}/openoffice" includes="*.jar" />
         <fileset dir="${dir.project.3rdparty.lib}/jmagick" includes="*.jar" />
         <fileset dir="${dir.project.3rdparty.lib}/commons" includes="*.jar" />
         <fileset dir="${dir.project.3rdparty.lib}/jgroups" includes="*.jar" />
         <fileset dir="${dir.project.3rdparty.lib}/jbpm" includes="*.jar" />
         <fileset dir="${dir.project.3rdparty.lib}/fop" includes="*.jar"/>
      </copy>
     
      <!– copy webservices files –>
      <copy todir="${dir.deploy.tomcat}/alfresco/WEB-INF" verbose="${copy.verbose}">
         <fileset dir="${dir.project.remoteapi.src.webinf}"/>
      </copy>
      <copy todir="${dir.deploy.tomcat}/alfresco/wsdl" verbose="${copy.verbose}">
         <fileset dir="${dir.project.remoteapi.src.wsdl}" />
      </copy>
   </target>
  
   <target name="deploy-virtual-tomcat"
           description="Deploys to Virtual Tomcat (the virtualization server)"
           depends="init, clean-virtual-tomcat-deploy">
      <deploy-virtual-tomcat location="${home.virtualtomcat}" />
   </target>
  
   <target name="deploy-webclient-changes" depends="init">
      <copy todir="${dir.deploy.tomcat}/alfresco" verbose="${copy.verbose}">
         <fileset dir="${dir.project.webclient.src.web}" excludes="WEB-INF/**" />
      </copy>
   </target>

   <target name="start-tomcat"
           description="Starts the Tomcat server on Windows"
           depends="init">
      <exec dir="${home.tomcat}/bin"
            executable="cmd.exe"
            spawn="true">
         <arg line="/k startup.bat" />
      </exec>
   </target>

   <target name="start-tomcat-virtual"
           description="Starts the virtual Tomcat server on Windows"
           depends="init">
      <exec dir="${home.virtualtomcat}/bin"
            executable="cmd.exe"
            spawn="true">
         <arg line="/k startup.bat" />
      </exec>
   </target>

   <target name="start-tomcat-debug"
           description="Starts the Tomcat server on Windows"
           depends="init">
      <fail unless="env.JPDA_ADDRESS"
            message="To run Tomcat in debug mode you need to setup the JPDA_ADDRESS enviornment variable"/>
      <fail unless="env.JPDA_TRANSPORT"
            message="To run Tomcat in debug mode you need to setup the JPDA_TRANSPORT enviornment variable"/>
     
      <exec dir="${home.tomcat}/bin"
            executable="cmd.exe"
            spawn="true">
         <arg line="/k catalina.bat jpda start" />
      </exec>
   </target>
  
   <target name="deploy-jboss"
           description="Deploys to JBoss"
           depends="clean-jboss-deploy">
      <!– ensure mysql drivers and xalan files are present –>
      <copy todir="${dir.deploy.jboss}"
            file="${dir.project.webclient.dist}/${file.name.war.webclient}" />
      <delete>
         <fileset dir="${home.jboss}/server/default/lib"
                  includes="mysql-connector*"
                  excludes="${file.name.jar.mysql.connector}" />
      </delete>

      <copy todir="${home.jboss}/server/default/lib"
            file="${dir.project.3rdparty.lib}/${dir.name.devenv}/${file.name.jar.mysql.connector}" />

      <!– copy the hotspot_compiler file to bin directory –>
      <copy todir="${home.jboss}/bin"
            file="${file.hotspotcompiler}" />
   </target>
  
   <target name="start-jboss"
           description="Starts the JBoss server on Windows"
           depends="init">
      <exec dir="${home.jboss}/bin"
            executable="cmd.exe"
            spawn="true">
         <arg line="/k start run.bat" />
      </exec>
   </target>

   <target name="deploy-amp"
           description="Deploys an AMP file to the web client WAR file. Usage deploy-amp -Dampfile=[ampfile]"
           depends="init">
      <fail unless="ampfile"
            message="You must supply the path to an AMP file using -Dampfile=[ampfile]"/>
      <install-amp ampfile="${ampfile}"
                   warfile="${dir.project.webclient.dist}/${file.name.war.webclient}" />
   </target>



   <!– ****************************************************** –>
   <!– ****************** Testing targets ******************* –>
   <!– ****************************************************** –>

   <target name="test"
           description="Runs unit tests for all the projects"
           depends="clean,
                    incremental,
                    test-core,
                    test-mbeans,
                    test-deployment,
                    test-repository,
                    test-remoteapi,
                    test-catalinavirtual,
                    test-webframework,
                    test-webclient,
                    test-webserviceclient" />

   <target name="run-junit-test"
           description="Runs a single JUnit test. Usage run-test -Dtestcase=[test] -Dprojectdir=[dir]"
           depends="init">
      <fail unless="testcase"
            message="You must supply a testcase to run using -Dtestcase=[test]"/>
      <fail unless="projectdir"
            message="You must supply a projectdir to run using -Dprojectdir=[dir]"/>

      <mkdir dir="${projectdir}/${dir.name.build}/${dir.name.test.results}" />

      <junit printsummary="yes"
             fork="yes"
             maxmemory="${mem.size.max}"
             haltonfailure="no"
             dir="${projectdir}">
         <jvmarg value="-server"/>
         <classpath refid="classpath.unit.test" />
         <formatter type="xml" />
         <test name="${testcase}"
               todir="${projectdir}/${dir.name.build}/${dir.name.test.results}" />
      </junit>
   </target>

   <!– Run a junit test without the irritatingly dumb junit task output in memory buffering –>
   <target name="run-test"
           description="Runs a single JUnit test bypassing the junit task. Usage run-test -Dtestcase=[test] -Dprojectdir=[dir]"
           depends="init">
      <fail unless="testcase"
            message="You must supply a testcase to run using -Dtestcase=[test]"/>
      <fail unless="projectdir"
            message="You must supply a projectdir to run using -Dprojectdir=[dir]"/>

      <mkdir dir="${projectdir}/${dir.name.build}/${dir.name.test.results}" />
      <java fork="yes"
            classname="junit.textui.TestRunner"
            dir="${projectdir}"
            output="${projectdir}/${dir.name.build}/${dir.name.test.results}/${testcase}.out">
         <jvmarg value="-Xmx${mem.size.max}"/>
         <jvmarg value="-server"/>
         <arg value="${testcase}"/>
         <classpath refid="classpath.unit.test"/>
      </java>
   </target>



   <!– ****************************************************** –>
   <!– ******************** Debug targets ******************* –>
   <!– ****************************************************** –>

   <target name="dump-properties"
           depends="dump-version,
                    dump-env-properties,
                    dump-dir-properties,
                    dump-file-properties" />

   <target name="dump-version"
           depends="init">
      <echo level="info">version.number = ${version.number}</echo>
   </target>

   <target name="dump-env-properties"
           depends="init">
      <echo level="info">basedir = ${basedir}</echo>
      <echo level="info">dir.projects = ${dir.projects}</echo>
      <echo level="info">user.home = ${user.home}</echo>
      <echo level="info">ant.home = ${ant.home}</echo>
      <echo level="info">home.tomcat = ${home.tomcat}</echo>
      <echo level="info">home.jboss = ${home.jboss}</echo>
      <echo level="info">home.findbugs = ${home.findbugs}</echo>
   </target>

   <target name="dump-dir-properties"
           depends="init">
       <echoproperties prefix="dir" />
   </target>

   <target name="dump-file-properties"
           depends="init">
      <echoproperties prefix="file" />
   </target>

   <target name="dump-arbitary-properties"
           depends="init">
      <fail unless="prefix"
            message="You must supply a prefix i.e. -Dprefix=file.name" />
      <echoproperties prefix="${prefix}" />
   </target>

   <target name="dump-all-properties"
           depends="init">
      <echoproperties />
   </target>

</project>

Gracias otra vez.

Outcomes