Questions tagged [maven-checkstyle-plugin]
99 questions
18
votes
1 answer
Maven Checkstyle Plugin doesn't fail during build even though `failsOnError` is set to `true`
My project enforces strict style so I have the maven-checkstyle-plugin running as part of my build.
org.apache.maven.plugins
maven-checkstyle-plugin
…

user2490003
- 10,706
- 17
- 79
- 155
15
votes
1 answer
Could not find artifact com.sun:tools:jar:0
I'm trying to use checkstyle and findbugs by doing mvn checkstyle:checkstyle but I have this error
This error
[ERROR] Failed to execute goal on project my-project: Could not resolve dependencies for project default:my-project:jar:1.1: Could not…

Leon
- 175
- 1
- 4
- 13
15
votes
3 answers
How to exclude module-info.java from checkstyle plugin checks?
After adding module-info.java files to my project my checkstyle plugin start failing with:
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check
(default-cli) on project email: Failed during checkstyle
…

Dmitriy Dumanskiy
- 11,657
- 9
- 37
- 57
8
votes
1 answer
maven-checkstyle-plugin failed to parse Java 'record'
I'm trying to setup checkstyle in our project - but seems like Maven (v3.8.3) or maven-checkstyle-plugin (v3.1.1) itself are not aware of Java 14's record (we use Java 17).
Caused by: java.lang.IllegalStateException:…

Dmitry Adonin
- 1,064
- 3
- 16
- 36
8
votes
1 answer
Old version of checkstyle detected. Consider updating to >= v8.30
Small question regarding a SonarQube + Checkstyle warning please.
Currently, in my app, in my pom, I use the following Checkstyle plugin:
org.apache.maven.plugins
…

PatPanda
- 3,644
- 9
- 58
- 154
8
votes
3 answers
SuppressionCommentFilter is not allowed as a child in Checker"
Error: The Checkstyle rules file could not be parsed.
SuppressionCommentFilter is not allowed as a child in Checker
The file has been blacklisted for the 60s.
Note: the Checkstyle version which I am using is 7.1.2.
This is with a config that seems…

Umesh Sulakude
- 286
- 2
- 14
7
votes
0 answers
Use of checkstyle.xml in diffplug/spotless
I have a checkstyle.xml file to check for formatting violations . Is there any way to provide checkstyle.xml as a input to diffplug/spotless formatter . Java8 is being used and spotless verison is 2.11.0 . If this is possible using spotless::apply…

darth_vader
- 149
- 10
6
votes
1 answer
Maven Checkstyle plugin with google_checks and 4 space indentSize
I am finding out ways to configure google_checks to use 4 spaces in the maven Checkstyle plugin. I set the indentSize configuration parameter to 4, but it does not work. Is there a configuration options to set this? I don't want to have my own…

Nikhil
- 345
- 2
- 13
6
votes
3 answers
Checkstyle LineLength configuration not working
When trying to add maven-checkstyle-plugin to my Java project, I'm facing some weird issues.
The checkstyle version is 3.1.0, that uses checkstyle version 8.19. Below is the checkstyle.xml the project is using:

luizfzs
- 1,328
- 2
- 18
- 34
5
votes
1 answer
Difference with Checkstyle and PMD configuration in maven parent module
I have a java application with maven having below structure:
parent
| - pom.xml
| - child
| - pom.xml
| - analyzers
| - pmdrules.xml
| - checkstyle.xml
I have configured both PMD and checkstyle in parent pom.xml. For PMD the rulesets…

ramtech
- 757
- 6
- 15
5
votes
1 answer
maven-checkstyle-plugin not working with google_checks.xml on macOS
I have a Java / Maven project that I build at home with Windows and was executing checkstyle properly. It's using the builtin ruleset, but I tried an external file as well.
Checking out the same code / pom.xml it doesn't seem to work with macOS. The…

Udo Held
- 12,314
- 11
- 67
- 93
5
votes
1 answer
Maven Checkstyle Plugin - Change location of file checkstyle-checker.xml in ${project.build.directory}
Trying to clean up my ${project.build.directory}, I noticed that maven-checkstyle-plugin puts three files into my target folder: checkstyle-checker.xml, checkstyle-cachefile and checkstyle-result.xml.
I was able to redirect the last two into their…

numberfourteen
- 143
- 1
- 12
4
votes
1 answer
After Checkstyle upgrade how to validate custom config xml
I have upgraded the maven-checkstyle-plugin from 2.17 to 3.1.1 and when running mvn checkstyle:checkstyle I have encountered numerous runtime errors such as (and the hard part was the errors would show 1 at a time - meaning you fix the 1st error…

Carlos Jaime C. De Leon
- 2,476
- 2
- 37
- 53
4
votes
0 answers
Importing checkstyle suppressions for IntelliJ code style
Mostly just out of curiosity, but if you are using a checkstyle configuration file checkstyle.xml and a (separate) suppression file checkstyle-suppressions.xml with the maven-checkstyle-plugin on a maven project, and you'd like to import those…

Rowan
- 91
- 3
4
votes
1 answer
Can I bundle import-control file for checkstyle for use in all projects using our checkstyle?
I am trying to add import-control to our checkstyle in such a way that the import-control file exists in the project making the checstyle.xml file and not in the projects we build later on.
We have a specific gradle project where we define all our…

Mårten Carlzon
- 71
- 4