Search code examples
javamavencheckstylemaven-checkstyle-plugin

How to exclude a file in the source root from Maven Checkstyle plugin checks?


I found Excluding classes in Maven Checkstyle plugin reports which explains well how to exclude classes with

<configuration>
  <excludes>**/package/...,**/otherpackage/...</excludes>
</configuration>

However, I don't seem to get how to exclude a file like LICENSE.txt in the source root.

I tried (for LICENSE.txt and NOTICE.txt)

<excludes>**/LICENSE.txt,**/NOTICE.txt</excludes>

and

<excludes>LICENSE.txt,NOTICE.txt</excludes>

which both still produce a warning for a missing license header.

The concrete project I'm trying to apply this on is Apache Commons FileUpload.


Solution

  • You can try using Surppressions Filter: https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/suppressions-filter.html