你好我收到以下錯誤:無法創建任務或類型的Cobertura儀器
build.xml:61: Problem: failed to create task or type cobertura-instrument
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
生成的.xml包含了以下目標:
<target name="instrument" depends="init,compile">
<!--
Remove the coverage data file and any old instrumentation.
-->
<delete file="cobertura.ser"/>
<delete dir="${instrumented.dir}" />
<!--
Instrument the application classes, writing the
instrumented classes into ${build.instrumented.dir}.
-->
<cobertura-instrument todir="${instrumented.dir}">
<!--
The following line causes instrument to ignore any
source line containing a reference to log4j, for the
purposes of coverage reporting.
-->
<ignore regex="org.apache.log4j.*" />
<fileset dir="${classes.dir}">
<!--
Instrument all the application classes, but
don't instrument the test classes.
-->
<include name="**/*.class" />
<exclude name="**/*Test.class" />
</fileset>
</cobertura-instrument>
</target>
Build.properties
# The source code for the examples can be found in this directory
src.dir=C:/Rahul/SVN_CodeBase/services/src
# The path to cobertura.jar
cobertura.dir=C:/Rahul/SVN_CodeBase/cobertura-2.0.3
# Classes generated by the javac compiler are deposited in this directory
classes.dir=C:/Rahul/SVN_CodeBase/services/build/classes
# Instrumented classes are deposited into this directory
instrumented.dir=services/build/classesinstrumented
# All reports go into this directory
reports.dir=services/build/reports
# Unit test reports from JUnit are deposited into this directory
reports.xml.dir=${reports.dir}/junit-xml
reports.html.dir=${reports.dir}/junit-html
# Coverage reports are deposited into these directories
coverage.xml.dir=${reports.dir}/cobertura-xml
coverage.summaryxml.dir=${reports.dir}/cobertura-summary-xml
coverage.html.dir=${reports.dir}/cobertura-html
please let me know how to resolve the above error tanks in advance.
你解決問題了嗎?你能否更新你的文章或取得正確的答案? –