I'm trying to add a JSP ruleset to an existing Maven build using PMD. Unfortunately, it seems like no matter what I do I get an error. If I add the reference to our existing ruleset:
<rule ref="rulesets/jsp/basic.xml/NoUnsanitizedJSPExpression" />
I get this message (linebreaks added for readability:
Execution DRY of goal org.apache.maven.plugins:maven-pmd-plugin:2.7.1:pmd failed:
Couldn't find that class Can't find resource rulesets/jsp/basic.xml.
Make sure the resource is a valid file or URL or is on the CLASSPATH -> [Help 1]
I've consulted this question and tried various permutations of leading slashes:
<rule ref="/rulesets/jsp/basic.xml/NoUnsanitizedJSPExpression" />
but I still get the error message referenced above.
I've tried adding the ruleset to the Maven plugin (second ruleset):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
<rulesets>
<ruleset>${project.basedir}/src/main/resources/properties/pmd_workspace.xml</ruleset>
<ruleset>rulesets/jsp/basic.xml</ruleset>
</rulesets>
</configuration>
<executions>
<execution>
<id>DRY</id>
<phase>test</phase>
<goals>
<goal>cpd</goal>
<goal>pmd</goal>
</goals>
</execution>
</executions>
</plugin>
but that simply gives me this error:
An error has occurred in PMD Report report generation. Could not find resource 'rulesets/jsp/basic.xml'. -> [Help 1]
I've looked at the documentation for PMD and for the Maven PMD plugin but had no luck. Can anyone help or point me to a tutorial?