title: PMD+Maven+JAVA Error:: Can't find resource rulesets/comments.xml. Make sure the resource is a valid file or URL or is on the CLASSPATH
body: <p>while adding a custom ruleset of PMD , maven is producing an error -<code>net.sourceforge.pmd.RuleSetNotFoundException: Can't find resource rulesets/comments.xml.Make sure the resource is a valid file or URL or is on the CLASSPATH</code>.</p>
  
  <p>For others rule sets like basic,naming etc its not giving any error.but when i add new ruleset it produced the error.
  I also tried <code>&lt;rule ref="rulesets/java/comments.xml/CommentRequired"/&gt;</code>but it also giving the same error.
  comments.xml is already available in pmd-5.0.2.jar file.</p>
  
  <p>My POM.xml</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.11&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;pmd&lt;/groupId&gt;
          &lt;artifactId&gt;pmd&lt;/artifactId&gt;
          &lt;version&gt;5.0.2&lt;/version&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.9.1&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;attach-javadocs&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;jar&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;outputDirectory&gt;${project.build.directory}/site/
                          &lt;/outputDirectory&gt;
                          &lt;reportOutputDirectory&gt;${project.reporting.outputDirectory}/site/
                          &lt;/reportOutputDirectory&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
  
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-pmd-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.7.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;targetjdk&gt;1.6&lt;/targetjdk&gt;
                  &lt;skip&gt;fasle&lt;/skip&gt;
                  &lt;failOnViolation&gt;false&lt;/failOnViolation&gt;
                  &lt;failurePriority&gt;4&lt;/failurePriority&gt;
                  &lt;verbose&gt;true&lt;/verbose&gt;
                  &lt;rulesets&gt;
                      &lt;ruleset&gt;src/main/resources/rulesets/MyRuleSet.xml&lt;/ruleset&gt;
                  &lt;/rulesets&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;check&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;check&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;id&gt;cpd-check&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;cpd-check&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;reporting&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-jxr-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3&lt;/version&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/reporting&gt;
  </code></pre>
  
  <p>My Custom Ruleset file</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0"?&gt;
  &lt;ruleset&gt;
  
  &lt;rule ref="rulesets/logging-java.xml/SystemPrintln"&gt;
      &lt;priority&gt;3&lt;/priority&gt;
  &lt;/rule&gt;
  &lt;rule ref="rulesets/naming.xml/VariableNamingConventions"&gt;
      &lt;priority&gt;3&lt;/priority&gt;
  &lt;/rule&gt;
  &lt;rule ref="rulesets/design.xml/UseSingleton"&gt;
      &lt;priority&gt;3&lt;/priority&gt;
  &lt;/rule&gt;
  &lt;rule ref="rulesets/controversial.xml/UseConcurrentHashMap"&gt;
      &lt;priority&gt;3&lt;/priority&gt;
  &lt;/rule&gt;
  &lt;rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcode"&gt;
      &lt;priority&gt;3&lt;/priority&gt;
  &lt;/rule&gt;
  
  &lt;rule ref="rulesets/comments.xml/CommentRequired"&gt;
      &lt;priority&gt;3&lt;/priority&gt;
  &lt;/rule&gt;
  &lt;/ruleset&gt;
  </code></pre>
  
  <p>Here is my maven stacktrace</p>
  
  <pre><code>    INFO] ------------------------------------------------------------------------
  net.sourceforge.pmd.RuleSetNotFoundException: Can't find resource rulesets/comments.xml. Make sure the resource is a valid file or URL or is on the CLASSPATH
      at net.sourceforge.pmd.util.ResourceLoader.loadResourceAsStream(ResourceLoader.java:28)
      at net.sourceforge.pmd.RuleSetFactory.parseRuleReferenceNode(RuleSetFactory.java:365)
      at net.sourceforge.pmd.RuleSetFactory.parseRuleNode(RuleSetFactory.java:255)
      at net.sourceforge.pmd.RuleSetFactory.parseRuleSetNode(RuleSetFactory.java:209)
      at net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java:157)
      at net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java:146)
      at org.apache.maven.plugin.pmd.PmdReport.generateReport(PmdReport.java:222)
      at org.apache.maven.plugin.pmd.PmdReport.execute(PmdReport.java:175)
      at org.apache.maven.plugin.pmd.PmdReport.executeReport(PmdReport.java:149)
      at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:190)
      at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:99)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions(MojoExecutor.java:364)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:198)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)
  </code></pre>