0

我找不到解决这个问题的方法,你能帮我吗?

    <project name="HelloWorldWS" default="dist" basedir=".">
    <description>
        Web Services build file
    </description>
  <!-- set global properties for this build -->
  <property name="src" location="src"/>
  <property name="build" location="build"/>
  <property name="dist"  location="dist"/>
  <property name="webcontent"  location="WebContent"/>

  <target name="init">
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}"/>
  </target>

    <target name="compile" depends="init" 
        description="compile the source ">
      <javac destdir="${build}" debug="true" srcdir="${src}" includeantruntime="false">
        <classpath refid="compile.classpath"/>
      </javac>
    </target>

  <target name="dist" depends="compile"
    description="generate the distribution" >

    <!-- Create the distribution directory -->
    <mkdir dir="${dist}/lib"/>

    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
    <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
  </target>

  <target name="war" depends="compile"
    description="generate the distribution war" >

    <!-- Create the war distribution directory -->
    <mkdir dir="${dist}/war"/>

    <!-- Follow standard WAR structure -->
    <copydir dest="${dist}/war/build/WEB-INF/" src="${webcontent}/WEB-INF/" />
    <copydir dest="${dist}/war/build/WEB-INF/classes/" src="${build}" />

    <jar jarfile="${dist}/war/HelloWorld-${DSTAMP}.war" basedir="${dist}/war/build/"/>
  </target>

  <target name="clean"
    description="clean up" >

    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>
</project>

我收到了这条消息:

Buildfile: E:\Bibliothèque logicielle\workspace\projetServices\build.xml init: compile: [javac] 警告:com\bh\dao\CompteDAO.java 以后会修改。[javac] 警告:com\bh\dao\GenericDAO.java 将来会被修改。[javac] 警告:com\bh\dao\Mouvement_CompteDAO.java 将来会被修改。[javac] 警告:com\bh\dao\SoldeDAO.java 将来会被修改。[javac] 警告:com\bh\dao\UserDAO.java 将来会被修改。[javac] 警告:com\bh\dao\VirementDAO.java 将来会被修改。[javac] 警告:com\bh\jpa\Avis.java 将来会被修改。[javac] 警告:com\bh\jpa\Compte.java 将来会被修改。[javac] 警告:com\bh\jpa\Mouvement_Compte.java 将来会被修改。[javac] 警告:com\bh\jpa\Solde.java 将来会被修改。[javac] 警告:com\bh\jpa\User.java 以后修改。[javac] 警告:com\bh\jpa\V1.java 以后会修改。[javac] 警告:com\bh\jpa\V2.java 以后会修改。[javac] 警告:com\bh\jpa\Virement.java 将来会被修改。[javac] 警告:com\bh\methods\FileMethods.java 将来会被修改。[javac] 警告:com\bh\services\HibernateUtils.java 以后会修改。[javac] 警告:com\bh\services\Serveur.java 将来会被修改。[javac] 警告:com\bh\services\Service.java 以后会修改。[javac] 警告:com\bh\services\ServicesInterface.java 以后会修改。[javac] 警告:com\bh\services\client\Avis.java 将来会修改。[javac] 警告:com\bh\services\client\Compte.java 将来会被修改。[javac] 警告:com\bh\services\client\ConsulterAvis.java 以后修改。[javac] 警告:com\bh\services\client\ConsulterAvisResponse.java 将来会被修改。[javac] 警告:com\bh\services\client\ConsulterListeCpt.java 将来会被修改。[javac] 警告:com\bh\services\client\ConsulterListeCptResponse.java 将来会被修改。[javac] 警告:com\bh\services\client\ConsulterSldChqCpt.java 将来会被修改。[javac] 警告:com\bh\services\client\ConsulterSldChqCptResponse.java 将来会修改。[javac] 警告:com\bh\services\client\Exception.java 将来会被修改。[javac] 警告:com\bh\services\client\Exception_Exception.java 将来会被修改。[javac] 警告:com\bh\services\client\ListerOperations.java 将来会修改。[javac] 警告:com\bh\services\client\ListerOperationsResponse.java 以后修改。[javac] 警告:com\bh\services\client\MouvementCompte.java 将来会修改。[javac] 警告:com\bh\services\client\ObjectFactory.java 将来会被修改。[javac] 警告:com\bh\services\client\Service.java 将来会被修改。[javac] 警告:com\bh\services\client\ServiceService.java 将来会被修改。[javac] 警告:com\bh\services\client\Solde.java 将来会被修改。[javac] 警告:com\bh\services\client\User.java 将来会被修改。[javac] 警告:com\bh\services\client\ValidationRIBC.java 将来会被修改。[javac] 警告:com\bh\services\client\ValidationRIBCResponse.java 将来会被修改。[javac] 警告:com\bh\services\client\VirementCompteACompte。日后修改java。[javac] 警告:com\bh\services\client\VirementCompteACompteResponse.java 将来会被修改。[javac] 警告:com\bh\services\client\VirementDeMasse.java 将来会被修改。[javac] 警告:com\bh\services\client\VirementDeMasseResponse.java 将来会被修改。[javac] 警告:com\bh\services\client\package-info.java 将来会修改。[javac] 警告:com\bh\tests\test.java 以后会修改。[javac] 警告:将来修改 hibernate.cfg.xml。[javac] 警告:将来修改 log4j.properties。[javac] 编译45个源文件到E:\Bibliothèque logicielle\workspace\projetServices\build [javac] 警告:com\bh\services\client\VirementDeMasse.java 将来会被修改。[javac] 警告:com\bh\services\client\VirementDeMasseResponse.java 将来会被修改。[javac] 警告:com\bh\services\client\package-info.java 将来会修改。[javac] 警告:com\bh\tests\test.java 以后会修改。[javac] 警告:将来修改 hibernate.cfg.xml。[javac] 警告:将来修改 log4j.properties。[javac] 编译45个源文件到E:\Bibliothèque logicielle\workspace\projetServices\build [javac] 警告:com\bh\services\client\VirementDeMasse.java 将来会被修改。[javac] 警告:com\bh\services\client\VirementDeMasseResponse.java 将来会被修改。[javac] 警告:com\bh\services\client\package-info.java 将来会修改。[javac] 警告:com\bh\tests\test.java 以后会修改。[javac] 警告:将来修改 hibernate.cfg.xml。[javac] 警告:将来修改 log4j.properties。[javac] 编译45个源文件到E:\Bibliothèque logicielle\workspace\projetServices\build [javac] 警告:com\bh\tests\test.java 以后会修改。[javac] 警告:将来修改 hibernate.cfg.xml。[javac] 警告:将来修改 log4j.properties。[javac] 编译45个源文件到E:\Bibliothèque logicielle\workspace\projetServices\build [javac] 警告:com\bh\tests\test.java 以后会修改。[javac] 警告:将来修改 hibernate.cfg.xml。[javac] 警告:将来修改 log4j.properties。[javac] 编译45个源文件到E:\Bibliothèque logicielle\workspace\projetServices\build

构建失败 E:\Bibliothèque logicielle\workspace\projetServices\build.xml:21:找不到参考 compile.classpath。

总时间:705 毫秒

在此处输入图像描述

请问有什么建议吗?

4

1 回答 1

2

您的: compile.classpath( <classpath refid="compile.classpath"/>) 未在构建脚本中的任何地方定义。

您必须定义库的路径。像这样的东西:

<property name="lib.dir" value="${basedir}/lib"/>
<path id="compile.classpath">
    <fileset dir="${lib.dir}" includes="*.jar"/>
</path>
于 2013-07-31T07:13:51.707 回答