I build my projects via mvn on the command line.
Whenever a checkStyle error occurs, I see this type of output:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-
plugin:2.4:checkstyle (default) on project myProject-server:
An error has occurred in Checkstyle report generation.
There are 2 checkstyle errors. -> [Help 1]
How do I find out which code lines are causing these CheckStyle failures?
To view to violation report, go to Window -> Show View -> Other, and search for Checkstyle. Options for Violations and Violations Chart should be displayed.
No Checkstyle Plugin If your build does not use either of the Gradle or Maven Checkstyle plugins, you can still configure the rewrite build plugins to use a checkstyle xml configuration file. At this point, you're ready to fix Checkstyle policy violations by running mvn rewrite:run or gradlew rewriteRun .
CheckStyle saves reports to target/checkstyle-result.xml
(for non-modular project). So you may find out this file and examine it.
Another case is to configure maven-checkstyle-plugin
to show all such warnings/error to console:
<consoleOutput>true</consoleOutput>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With