ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Holmes Jr." <...@tomholmes.net>
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"/>
           <classpath>
               <pathelement location="${env.ANT_HOME}/lib"/>
               <pathelement 
location="${user.home}/.ant/lib/pmd-4.2.2.jar"/>
           </classpath>
           <jvmarg value="-Xmx384M"/>
       </java>
   </target>

But, in doing this I am getting the error:   NoClassDefFoundError:  
org/apache/tools/ant/Task
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.    

Thanks!
                        Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message