Description
It is not possible to rely on two ruleset files that share the same filename (but are located in different directories).
Here is an sample configuration for a multi-module project where there is a common pmd-ruleset.xml file in the parent project and a pmd-ruleset.xml file in each sub-module. (This is not limited to multi-module projects, it could be any configuration where the same filename is used in different directories.)
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>${pmd-maven-plugin.version}</version> <configuration> <rulesets> <ruleset>${project.basedir}/pmd-ruleset.xml</ruleset> <ruleset>${project-root.basedir}/pmd-ruleset.xml</ruleset> </rulesets> </configuration> </plugin>
The files specified in the <ruleset /> elements are copied into ${project.build.directory}/pmd/rulesets, but only the actual filename is taken into account during the copy, so the second copy overwrites the first.
This seems to be due to the implementation of PmdReport.resolveRulesets(...) and PmdReport.getLocationTemp(...)
Attachments
Issue Links
- links to