Сборка Ant TestNG работает в Eclipse, но не с терминала

Я могу запустить сборку Ant из Eclipse, щелкнув правой кнопкой мыши и выбрав Ant Build.

Когда я пытаюсь выполнить ту же сборку, запустив Ant из cmd, я получаю результат «Сборка прошла успешно», но ничего не создается.

Файл сборки.xml

<property name ="build.dir" value="${basedir}/build"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="name" value="value"/>

<target name="setClassPath">
    <path id="classpath_jars">
        <path id="${basedir}/"/>
        <fileset dir="${lib.dir}" includes="*.jar"/> 
    </path>
<pathconvert pathsep=":" property="test.classpath" refid="classpath_jars"/>
</target>

<target name="loadTestNG" depends="setClassPath">
    <taskdef resource="testngtasks" classpath="${test.classpath}"/>
</target>

<target name="init">
    <mkdir dir="${build.dir}"/>
</target>

<target name="clean">
    <echo message="deleting existing build directory"/>
    <delete dir="${build.dir}"/>
</target>

<target name="compile" depends="clean, init, setClassPath, loadTestNG">
    <echo message="classpath: ${test.classpath}"/>
    <echo message="compiling..."/>
    <javac destdir="${build.dir}" srcdir="${src.dir}" classpath="${test.classpath}"           encoding="cp1252"/>
</target>

<target name="run" depends="compile">
    <testng classpath ="${test.classpath}:${build.dir}">
    <xmlfileset dir="${basedir}" includes="testng.xml"/>
    </testng>

</target>

</project>

And the Testng.xml

<suite name="Regression Test Suite">

  <test name="My Test">

  <classes>

    <class name="com.RegressionTest.Sometest"/>

  </classes>

  </test>

</suite>

person Armando    schedule 15.07.2011    source источник


Ответы (1)


Я определил проблему. Я не указал цель по умолчанию в настройках моего проекта. Eclipse IDE удалось скомпилировать, но в терминале я использовал только ANT и не указывал, какую цель собирать. Итак, он успешно «строился», потому что я не говорил ему, что строить.

person Armando    schedule 17.07.2011
comment
Привет, Армандо, я знаю, что это было давно, но ты помнишь, где ты это указал? - person kb_; 23.04.2014