Using an Inline Checkstyle Checker Configuration

Since version 2.12, an inlined Checker configuration can be defined directly in the configuration section of the plugin itself inside your pom.xml.

This is especially useful when the Checkstyle checks should be executed with every compile and you do not like to create an own project for your Checkstyle rules and neither like to have a separate parent POM structure.

To define a custom Checkstyle checker configuration inside your pom.xml, use the checkstyleRules parameter.

            <module name="Checker">

              <!-- Checks for Size Violations.                    -->
              <!-- See -->
              <module name="FileLength">
                <property name="max" value="3500" />
                <property name="fileExtensions" value="java"/>

              <!-- Checks for whitespace                               -->
              <!-- See -->
              <module name="FileTabCharacter"/>

              <module name="TreeWalker">
                <module name="StaticVariableName"/>
                <module name="TypeName">
                  <property name="format" value="^_?[A-Z][a-zA-Z0-9]*$"/>