2014-01-23 49 views
0

擺脫LIB的我試圖配置ANT的TestNG的,但有問題的如何從classpath中ANT TestNG的ECLIPSE

<project basedir="." default="build" name="Ant Play"> 
    <property name="classes.dir" value="bin" /> 
    <property name="report.dir" value="test-output" /> 
    <path id="classpath"> 
     <fileset dir="."> 
      <include name="**/*.jar"/> 
     </fileset> 
     <pathelement path="${basedir}\${classes.dir}"/> 
    </path> 
    <target name="init"> 
     <mkdir dir="${classes.dir}"/> 
     <copy includeemptydirs="false" todir="${classes.dir}"> 
      <fileset dir="src"> 
       <exclude name="**/*.java"/> 
      </fileset> 
     </copy> 
    </target> 
    <target name="clean"> 
     <delete dir="${classes.dir}"/> 
    </target> 
    <target depends="clean" name="cleanall"/> 
    <target depends="build-project" name="build"/> 
    <target depends="init" name="build-project"> 
     <echo message="${ant.project.name}: ${ant.file}"/> 
     <javac debug="true" includeantruntime="false" destdir="${classes.dir}"> 
      <src path="src"/> 
      <classpath refid="classpath"/> 
     </javac> 
    </target> 
    <target depends="build" name="runTests" description="Running tests" > 
     <echo>Running Tests...</echo> 
     <taskdef resource="testngtasks" classpathref="classpath"/> 
     <testng outputDir="${report.dir}" 
      haltonfailure="true" 
      useDefaultListeners="false" 
      listeners="org.uncommons.reportng.HTMLReporter" 
      classpathref="classpath"> 
      <xmlfileset dir="${basedir}" includes="testng.xml"/> 
      <!--<classfileset dir="${classes.dir}" includes="**/*.class" />--> 
     </testng> 
    </target> 
</project> 

但它拒絕讓classpath中 我得到........ ........../.../.../lib不存在。 我在我的項目中沒有lib 如何更改類路徑?它應該是哪個文件夾? 謝謝!

回答

0

我找到了解決辦法 手動創建lib文件夾>>>複製到LIB所有需要的jar文件添加>>>這些罐子路徑 和它的工作

相關問題