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.
  • acceptAsciiSubset - a boolean, accept US-ASCII as an subset of UTF-8 and ISO-8859-1/-15, default false.
  • acceptIso8859Subset - a boolean, accept ISO-8859-1 as a subset of ISO-8859-15, default false.

Sample Plugin Configuration:

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


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