ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Holmes Jr." <>
Subject CPD using Java Call
Date Wed, 06 Aug 2008 19:19:11 GMT
We tried the CPD (from PMD) ant call, but because we have so many 
classes, we get an outofmemory exception.

We can do the java command-line which works fine and dumps the output to 
the command-line:
java -Xmx384m -classpath ../../.ant/lib/pmd-4.2.2.jar  
net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --files ./src --format 
net.sourceforge.pmd.cpd.XMLRenderer --output ./buildreports/report.cpd.xml

So, what I want to do is use the ant "java" task as listed below  so 
that the CPD runs in it's own JVM with a different heap space size.
<target name="cpd" depends="set_filters,prepare">
       <taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask" />
       <java classname="net.sourceforge.pmd.cpd.CPDTask" fork="true" >
           <arg value="--minimum-tokens 100"/>
           <arg value="--format net.sourceforge.pmd.cpd.XMLRenderer"/>
           <arg value="--files ${basedir}/src"/>
               <pathelement location="${env.ANT_HOME}/lib"/>
           <jvmarg value="-Xmx384M"/>

But, in doing this I am getting the error:   NoClassDefFoundError:  
I didn't think I had to, or needed to, include the jars from ant.

Can anyone give me a quick solution ... I feel that I am almost there.    


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message