Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a checkstyle report as xml file and want to generate a html report which lists what kind of errors occurred how many times and in which files they occurred. Something like this example.

Is there a tool to do that?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
460 views
Welcome To Ask or Share your Answers For Others

1 Answer

If you are using mvn to do this, mvn checkstyle:checkstyle will generate an xml format report, or with the option -Dcheckstyle.output.format=plain just plain text. Both of these will only list the errors and won't give any summary.

The summary html file is found in the target directory, however I found the images and the CSS are missing so it looks pretty bad.

mvn site will generate the HTML format report like your image. However it will also generate large amounts of other reporting material and takes a long time.

I've also found another problem - mvn checkstyle:checkstyle will only find your config files if you include the file:// protocol in the checkstyle plugin config, e.g.

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

However mvn site only takes a directory, and can't handle the file://


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...