ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: PMD
Date Fri, 31 Jan 2003 17:06:21 GMT
Here's how I've experimented with it, after dropping pmd-1.01.jar in my
$ANT_HOME/lib. Works for me... --DD

  <!-- ========================== -->
  <target name="pmd">
    <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" />

    <!-- Use path to avoid very long comma-separated ruleset files list -->
    <path id="rules">
      <!--
      <pathelement location="rulesets/strings.xml" />
      <pathelement location="rulesets/junit.xml" />
      <pathelement location="rulesets/braces.xml" />
      <pathelement location="rulesets/basic.xml" />
      <pathelement location="rulesets/unusedcode.xml" />
      <pathelement location="rulesets/design.xml" />
        -->
      <!-- Complains too much about short variable length
      <pathelement location="rulesets/naming.xml" />
        -->
      <pathelement location="rulesets/imports.xml" />
      <!--
      <pathelement location="rulesets/codesize.xml" />
        -->
    </path>
    <pathconvert property="rules" refid="rules" dirSep="/" pathSep=",">
      <map from="${basedir}${file.separator}" to="" />
    </pathconvert>

    <pmd rulesetfiles="${rules}"
         format="html" reportFile="${logs}/pmd-report.html" verbose="true">
      <!-- Only available in CVS version...
      <formatter type="html" toFile="${logs}/pmd-report.html" />
        -->
      <fileset dir="${src}">
        <include name="**/*.java" />
        <exclude name="**/test/**" />
      </fileset>
    </pmd>

    <echo message="PMD (Project Mess Detector) report browsable at:" />
    <echo message="${logs}${file.separator}pmd-report.html" />
  </target>

-----Original Message-----
From: Ciramella, Edward [mailto:ECiramella@emptoris.com] 
Sent: Friday, January 31, 2003 10:59 AM
To: 'Ant Users List'
Subject: PMD

Has anyone here used pmd?  

It keeps blowing up on me saying:
"net.sourceforge.pmd.PMDException: Error while parsing com/....."

But there isn't a decent error message.

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


Mime
View raw message