Ernst Reissner created MPMD-222:
-----------------------------------

             Summary: ruleset via rulesetfile does not work
                 Key: MPMD-222
                 URL: https://issues.apache.org/jira/browse/MPMD-222
             Project: Maven PMD Plugin
          Issue Type: Bug
          Components: PMD
    Affects Versions: 3.6
         Environment: 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

            Reporter: Ernst Reissner
             Fix For: 3.7


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. 


 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to