Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ruleset not found error while customizing PMD.

 
Piyush Tripathi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm adding a new rule to Java code analysis tool PMD using it in standalone version.I write the rule class and compile that with the jar file pmd14-4.2.4.jar. Then i add the rule's .class file to the pmd14-4.2.4.jar file.After that i write the rule's xml file and add that too to the pmd14-4.2.4.jar file.Then i add the ruleset reference to the all-java.xml file present in the pmd14-4.2.4.jar.
Then i run the tool on the commandline as follows-

C:\PMD\java14\bin>pmd.bat f:\my\somecode.java xml rulesets/nestedloopscheck.xml

It gives 'Ruleset not found' error. Some part of the error is listed below.

C:\PMD\java14\bin>pmd.bat f:\my\somecode.java xml rulesets/nestedloopscheck.xml
Ruleset not found
net.sourceforge.pmd.RuleSetNotFoundException: Can't find resource rulesets/neste
dloopscheck.xml. Make sure the resource is a valid file or URL or is on the CLA
SSPATH. Here's the current classpath: C:\PMD\java14\bin\/../../java14/lib/pmd14
-4.2.4.jar;C:\PMD\java14\bin\/../../lib/asm-3.1.jar;C:\PMD\java14\bin\/../../lib
/jaxen-1.1.1.jar;C:\PMD\java14\bin\/../../java14/lib/retroweaver-rt-2.0.5.jar;C:
\PMD\java14\bin\/../../java14/lib/backport-util-concurrent.jar;%CLASSPATH%;.;C:\
ant\jakarta-ant-1.4.1\bin;C:\ant\jakarta-ant-1.4.1\lib;C:\j2sdk1.4.2_03\bin;
at net.sourceforge.pmd.RuleSetFactory.tryToGetStreamTo(RuleSetFactory.ja
va:171)
at net.sourceforge.pmd.RuleSetFactory.createSingleRuleSet(RuleSetFactory
.java:135)
at net.sourceforge.pmd.RuleSetFactory.createRuleSets(RuleSetFactory.java
:85)
at net.sourceforge.pmd.RuleSetFactory.createRuleSets(RuleSetFactory.java
:70)
at net.sourceforge.pmd.PMD.doPMD(PMD.java:359)
at net.sourceforge.pmd.PMD.main(PMD.java:415)

Feb 11, 2009 2:56:29 PM net.sourceforge.pmd.PMD doPMD
SEVERE: Ruleset not found


What am I doing wrong.Can anyone suggest me?

Thanks in advance,
Piyush
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic