-
Notifications
You must be signed in to change notification settings - Fork 41
Description
This plugin relies on .ruleset file available inside workspace plugin directory.
In Mac this is /<path>/.metadata/.plugins/net.sourceforge.pmd.eclipse.plugin/ruleset.xml
In our case, workspace files are not checked in to GIT. So we need to rely on the ruleset file from the source code.
Problem is the ruleset file (.pmd.xml) file relative to workspace is not picked up. This file is defined in
- build.properties (maven.pmd.rulesetfiles = ${basedir}/.pmd.xml)
- pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.6</version>
<configuration>
<includeTests>false</includeTests>
<minimumTokens>100</minimumTokens>
<linkXref>true</linkXref>
<rulesets>
<ruleset>${project.basedir}/.pmd.xml</ruleset>
</rulesets>
<failOnViolation>false</failOnViolation>
</configuration>
</plugin>
Question:
How can this file (.pmd.xml) be fed to pmd eclipse plugin automatically. We want PMD plugin to use only this file and not the default ones that come with the plugin.
Interestingly, exclude patterns mentioned in this file is picked up but not the rules.
Note:
I can still achieve this by going to Preferences -> PMD -> Rule Configuration -> Use Global RuleManagement -> Delete all rules -> import all rules using the file '.pmd.xml'
This requires developers to do this step every time they create a workspace.
Not sure if this is related to PULL pmd/pmd#36