Fork me on GitHub

Require Encoding

This rule checks files for a required encoding and fails if the guessed encoding doesn't match the required one.

Note that this rule uses icu4j to guess the source encoding of a file. Use of US-ASCII is hard to detect and should not be used as a required encoding.

The following parameters are supported by this rule:

  • encoding - Required encoding. Default value ${}.
  • includes - List of files to include, separated by comma or pipe
  • excludes - List of files to exclude, separated by comma or pipe
  • useDefaultExcludes - enable SCM file exclusions, enbled by default.
  • failFast - Should the rule fail after the first error or should the errors be aggregated. Default true.

Sample Plugin Configuration:

        <version>1.0</version> <!-- find the latest version at -->


Apache, Apache Maven, Maven and the Apache feather logo are trademarks of The Apache Software Foundation.