Blog
I've set up a precompiled Maven Checkstyle Plugin with MCHECKSTYLE-91 fixed. Follow this link to download the plugin.
Alternatively, you may put the following plugin definition to your pom.xml
:
<project> ... <pluginRepositories> <pluginRepository> <id>joest</id> <name>Maven Repository repo.joest.org</name> <url>http://repo.joest.org</url> </pluginRepository> </pluginRepositories> ... <reporting> <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.2-MCHECKSTYLE-91</version> <configuration> ... </configuration> </plugin> ... </plugins> </reporting> ... </project>
During Christmas time, I digged into the internals of Checkstyle and the Maven Checkstyle plugin. Automated code review is a must for any serious software development project and, to my mind, nearly all of the standard rules provided by Checkstyle should be made mandatory in a way that violations break the build. But there is a difference between main and test sources. For example, there is no point in writing Javadocs on unit tests, and thus it's annoying to have Checkstyle constantly complaining about it.
Unfortunately, version 2.2 of the Maven Checkstyle plugin doesn't allow for applying different rules to main and test sources. So I started to write a patch that adds a new parameter testConfigLocation
to the Checkstyle report generator.
The patch should be applied against Subversion revision 728546 of
http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-checkstyle-plugin.
Here's my public key:
Public Key: 0xe3a9a5caeb2a4cd0
Created: 2008-11-20
Expiration: 2009-05-19
mQGiBEklXYYRBADTAu8z4T7wQfuvyNtYAiH+XQKy+1LtLhRqkSGmL+woWKUiFwFUTLlWeIju LJeVW1lJJiD/TD/HoQIKElHpuQ8GSif3h5RxBwOC8BxWtbm1wEW6W20mi2IMH/Kesz33LO6V PTbr8UP91uZJVoCON3txqSbRtewFB3t/fNZn4w3NRwCgjihZEckXPCqjSSBe20mPo2nuxikD /1Ek+mN0UFC+2kTU7ZyaagjjrXQG4bHx36yGtDbtekLRmxV2nIUGWZqnG7bbGEgVED1uuvG9 oC5kaHqLixXW7b+J1NQoQFmfH14gPSz4mxBjIZBZwMIgsRWpwl/KeyU0tZd0jiYEc+apyHDL dSN4mmJgzvYDn95Wxj9JrN1gz+tJA/9iD5CwM1HbgrWM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qnQg61a2ff7R0tcuWkO4 3BiFW2uMMa4Lrnp00TJqddOiRFudq/eSmWpT9mwplAmNNPmnB2eF+wejmZRLwcvSuVvHe09q d1JvqUM51BAX9S6OzaMHxbitK75V9JhfBVxaeMlWlo99JnMWHr9JZHxGiE8EGBECAA8FAkkl XYwCGwwFCQDtTgAACgkQ46mlyusqTNAbIgCeJaY95AbmRxJbleTmT0pIHYi/COAAnRLbIIbh ldOXOnswsItq3CGLpzcQ =PiLG
Javadoc is a tool for generating API documentation, but unit tests don't have APIs. It's fine to write comments on unit tests. But Javadoc doesn't make sense for unit tests.
Why violations of Checkstyle rules should break the build.