I am injecting checkstyle maven plugin in my Java project. And I have one problem. The problem is that the plugin checks for a style license, which is placed inside the source code file.
What gives me an error:
[ERROR] src/main/java/io/github/eocqrs/kafka/consumer/KfConsumer.java:[11] (sizes)
LineLength: Line is longer than 80 characters (found 81).
How do I turn off the license block check?
So, I found a solution, not without the help of comments.
The first thing I had to do was to determine which block I needed to exclude for the test. In my case it was from line 0 to line 23. Then I had to create a file
checkstyle-suppressions.xmlwhich would look like thisIn it I've listed all the checks I wanted to exclude for the license block. Also to check only Java sources I specified with regex file type -
.*\.java$.Next, in project
pom.xmlI specified the
suppressionsLocationconfiguration file I needed and the requiredsuppressionsFileExpressionsetting