Uploaded image for project: 'Maven PMD Plugin'
  1. Maven PMD Plugin
  2. MPMD-222

ruleset via rulesetfile does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 3.6
    • 3.6
    • PMD
    • uname -a
      Linux linux-tanr.site 4.1.21-14-default #1 SMP PREEMPT Sun Apr 17 07:27:45 UTC 2016 (fc187c1) x86_64 x86_64 x86_64 GNU/Linux
    • Patch, Important

    Description

      in my pom i wrote
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-pmd-plugin</artifactId>
      <version>3.6</version><!-- belongs to PMD 5.3.5 -->
      <configuration>
      <skip>false</skip>
      <rulesets>
      <ruleset>${maven.pmd.rulesetfiles}</ruleset>
      </rulesets>

      and maven.pmd.rulesetfiles is defined as
      maven.pmd.rulesetfiles>${basedir}/config/myruleset.xml</maven.pmd.rulesetfiles>

      which in turn looks like this:

      <?xml version="1.0"?>

      <ruleset name="myruleset"
      xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
      <rule ref="rulesets/java/typeresolution.xml" />
      </ruleset>

      Then a violation of SignatureDeclareThrowsException is not detected,
      whereas if directly specifying

      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-pmd-plugin</artifactId>
      <version>3.6</version><!-- belongs to PMD 5.3.5 -->
      <configuration>
      <skip>false</skip>
      <rulesets>
      <ruleset>rulesets/java/typeresolution.xml/SignatureDeclareThrowsException</ruleset>

      it works fine.
      So I think it is not a problem with pmd but with the plugin.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ErnstReissner Ernst Reissner
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: