It's not fixed!
Yes, the "<excludes>" in maven works well, I use it, but the issue is about the <exclude-pattern> ...
But, the "<exclude-pattern>" doesn't work in a ruleset xml file (like explained in the url listed in the original issue).
I just tested it several times against 2.5. I changed the package pattern, etc... but didn't got it to work. The only way I got it to exclude to run the rule against the gwt pacakges was to exclude the complete file that contains the rulesets
... See below for details, I hope this helps.
Example: I use it to exclude rules against google GWT code.
My pom snippet:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.5</version>
<configuration>
<rulesets>
<ruleset>../rulesets/basic.xml</ruleset>
....
....
<ruleset>../rulesets/safeGwt.xml</ruleset>
</rulesets>
<linkXref>true</linkXref>-->
<sourceEncoding>utf-8</sourceEncoding>
<minimumTokens>100</minimumTokens>
<targetJdk>$
{java.version}
</targetJdk>
<excludes>
<exclude>**/Assert.java</exclude>
</excludes>
</configuration>
<dependencies>
<dependency>
<groupId>bla</groupId>
<artifactId>project containing the rulesets in the classpath.</artifactId>
<version>$
{version.ited.gen}
</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>$
{report.phase}
</phase>
<goals>
<goal>check</goal>
<goal>cpd-check</goal>
</goals>
</execution>
</executions>
</plugin>
And the safeGwt.xml contains (not all rules included):
<ruleset name="Custom ruleset" 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">
<!-- Exclude the gwt packages -->
<exclude-pattern>./gwt/.</exclude-pattern>
<rule name="NonThreadSafeSingleton" message="Singleton is not thread safe"
class="net.sourceforge.pmd.rules.design.NonThreadSafeSingleton"
[... all rule details ...]
</rule>
</ruleset>
he..
i have the same problem with it. It seems that this issue is too unimportant to change.
So i looked into the source... and i asked me, why isn't the pmd.main() used to call pmd ?!
(ok, there is not so much configuration possible... )
But the latest pmd version can easily be configured...
any suggestions?
thanks...