I am using Maven 3 and Checkstyle 2.9.1 in my java project and I have a common checkstyle configuration that we're using in several other projects as well. To avoid copying and editing that configuration file into my own project I use a suppressions file to disable all checks in some packages (generated code).
Now I want to suppress specific rules in all files.
This is my suppressions file:
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.1//EN" "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<suppress files="my[\\/]generated[\\/]code[\\/]package" checks="."/>
<suppress files=".*\\.java$" checks="IndentationCheck"/>
<suppress files=".*\\.java$" checks="LineLengthCheck"/>
<suppress files=".*\\.java$" checks="ExplicitInitializationCheck"/>
<suppress files=".*\\.java$" checks="MemberNameCheck"/>
</suppressions>
This is my POM:
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<configLocation>${checkstyle.ruleset}</configLocation>
<suppressionsLocation>${checkstyle.suppressions}</suppressionsLocation>
</configuration>
</plugin>
</plugins>
</build>
I'm then calling
mvn checkstyle:checkstyle
to generate the reports, but the suppressed warnings are still in there.
What am I doing wrong here?