0

I am trying to use CRAP4J utility to analyse my code and I am stuck while passing the classpath. My ant task look like as follows;

<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>

When I run my target it gives me following error;

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.

According to CRAP4J documentation in I should be passing the fileset but the problem is that I do not have my dependencies at one location, they are scattered all over. Could you please help me sort this problem or give me suggestion on how to proceed now?

Thanks

--

Sjunejo

SJunejo
  • 1,316
  • 4
  • 23
  • 39
  • I have updated my script and now I am copying all my files locally into project lib directory and CRAP4J is going forward but its failing now on following; [echo] CRAP4J_HOME = C:\Utils\crap4j [crap4j] java.lang.IllegalArgumentException: Cannot figure out Crap4j Home!! [crap4j] at org.crap4j.Main.getCrap4jHomeFromClass(Main.java:126) The CRAP4J_HOME is set correctly in my environment! – SJunejo Jun 01 '12 at 11:49
  • please use the edit function (edit button below the question) for updates – oers Jun 01 '12 at 15:48

1 Answers1

1

Apparently its a bug in CRAP4J. Refer following link for solution;

http://code.google.com/p/crap4j/issues/detail?id=12

Thanks,

--

SJunejo

SJunejo
  • 1,316
  • 4
  • 23
  • 39