How to create Checkstyle reports?

I have a checkstyle report as an xml file and you want to create an html report that lists what errors occurred, how many times and in which files they occurred. Something like this is an example .

Is there a tool for this?

+4
source share
1 answer

If you use mvn for this, mvn checkstyle:checkstyle will generate an xml format report or with the -Dcheckstyle.output.format=plain option only plain text. Both of them will list only errors and will not give any summaries.

The html summary file is in the destination directory, however I found that the images and CSS are missing, so they look pretty bad.

mvn site will generate an HTML format report like your image. However, it will also generate a large number of other reporting materials and is time consuming.

I also found another problem - mvn checkstyle:checkstyle will find your configuration files only if you include the file:// protocol in the configuration of the checkstyle plugin, for example.

  <plugin> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.13</version> <configuration> <configLocation>file://${basedir}/checkstyle/checkstyle.xml</configLocation> </configuration> </plugin> 

However, mvn site only accepts a directory and cannot process file://

+2
source

All Articles