checkstyle:check

Full name:

org.apache.maven.plugins:maven-checkstyle-plugin:2.3:check

Description:

Perform a violation check against the last Checkstyle run to see if there are any violations. It reads the Checkstyle output file, counts the number of violations found and displays it on the console.

Attributes:

  • Requires a Maven 2.0 project to be executed.
  • Requires dependency resolution of artifacts in scope: compile.
  • Binds by default to the lifecycle phase: verify.
  • Invokes the execution of this plugins goal {0} prior to executing itself.

Optional Parameters

Name Type Since Description
failOnViolation boolean - Do we fail the build on a violation?
Default value is: true.
logViolationsToConsole boolean 2.3 Output the detected violations to the console.
Default value is: false.
maxAllowedViolations int 2.3 The maximum number of allowed violations. The execution fails only if the number of violations is above this limit.
Default value is: 0.
outputFile File - Specifies the path and filename to save the Checkstyle output. The format of the output file is determined by the outputFileFormat parameter.
Default value is: ${project.build.directory}/checkstyle-result.xml.
outputFileFormat String - Specifies the format of the output to be used when writing to the output file. Valid values are "plain" and "xml".
Default value is: xml.
skip boolean 2.2 Skip entire check.
Default value is: false.
violationSeverity String 2.2 The lowest severity level that is considered a violation. Valid values are "error", "warning" and "info".
Default value is: error.

Parameter Details

failOnViolation:

Do we fail the build on a violation?
  • Type: boolean
  • Required: No
  • Expression: ${checkstyle.failOnViolation}
  • Default: true

logViolationsToConsole:

Output the detected violations to the console.
  • Type: boolean
  • Since: 2.3
  • Required: No
  • Expression: ${checkstyle.console}
  • Default: false

maxAllowedViolations:

The maximum number of allowed violations. The execution fails only if the number of violations is above this limit.
  • Type: int
  • Since: 2.3
  • Required: No
  • Expression: ${checkstyle.maxAllowedViolations}
  • Default: 0

outputFile:

Specifies the path and filename to save the Checkstyle output. The format of the output file is determined by the outputFileFormat parameter.
  • Type: java.io.File
  • Required: No
  • Expression: ${checkstyle.output.file}
  • Default: ${project.build.directory}/checkstyle-result.xml

outputFileFormat:

Specifies the format of the output to be used when writing to the output file. Valid values are "plain" and "xml".
  • Type: java.lang.String
  • Required: No
  • Expression: ${checkstyle.output.format}
  • Default: xml

skip:

Skip entire check.
  • Type: boolean
  • Since: 2.2
  • Required: No
  • Expression: ${checkstyle.skip}
  • Default: false

violationSeverity:

The lowest severity level that is considered a violation. Valid values are "error", "warning" and "info".
  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • Expression: ${checkstyle.violationSeverity}
  • Default: error