我正在尝试使用 CRAP4J 实用程序来分析我的代码,但在传递类路径时遇到了困难。我的 Ant 任务如下所示;
<target name="run-crap-4j" unless="crap-4j-finishes" depends="init" description="This target will run crap-4j for analysis." >
<crap4j projectdir="${basedir}" outputDir="${build.dir}${file.separator}reports${file.separator}crap4j"
dontTest="false" debug="false">
<srces>
<pathElement location="${base.dir}${file.separator}src" />
</srces>
<classes>
<pathElement location="${build.dir}${file.separator}classes" />
</classes>
<testClasses>
<pathElement location="${build.dir}${file.separator}testclasses" />
</testClasses>
<libClasspath>
<path refid="${project.classpath}" />
<path refid="${test.classpath}" />
</libClasspath>
</crap4j>
<property name="crap-4j-finishes" value="true"/>
</target>
当我运行我的目标时,它给出以下错误;
run-crap-4j:
Unresolvable reference ${project.classpath} might be a misuse of property expansion syntax.
BUILD FAILED
C:\RTC\TechDev\SoaFramework\build.xml:931: Reference ${project.classpath} not found.
根据 CRAP4J 文档,我应该传递文件集,但问题是我的依赖项不在一个位置,它们分散在各处。您能帮我解决这个问题或者给我建议如何继续吗?
谢谢
--
苏内霍
最佳答案
关于java - Crap4j libClassPath 作为路径引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10848822/