Details
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.