• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ruleset not found error while customizing PMD.

Piyush Tripathi
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
at net.sourceforge.pmd.RuleSetFactory.tryToGetStreamTo(RuleSetFactory.ja
at net.sourceforge.pmd.RuleSetFactory.createSingleRuleSet(RuleSetFactory
at net.sourceforge.pmd.RuleSetFactory.createRuleSets(RuleSetFactory.java
at net.sourceforge.pmd.RuleSetFactory.createRuleSets(RuleSetFactory.java
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,
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic