pmd:check

Full name:

org.apache.maven.plugins:maven-pmd-plugin:3.6:check

Description:

Fail the build if there were any PMD violations in the source code.

Attributes:

  • Requires a Maven project to be executed.
  • The goal is thread-safe and supports parallel builds.
  • Since version: 2.0.
  • Binds by default to the lifecycle phase: verify.
  • Invokes the execution of this plugin's goal pmd prior to executing itself.

Required Parameters

Name Type Since Description
failOnViolation boolean 2.0 Whether to fail the build if the validation check fails.
Default value is: true.
User property is: pmd.failOnViolation.
failurePriority int 2.0 What priority level to fail the build on. Failures at or above this level will stop the build. Anything below will be warnings and will be displayed in the build output if verbose=true. Note: Minimum Priority = 5 Maximum Priority = 0
Default value is: 5.
User property is: pmd.failurePriority.
targetDirectory File 2.0 The location of the XML report to check, as generated by the PMD report.
User property is: project.build.directory.

Optional Parameters

Name Type Since Description
aggregate boolean 2.2 Whether to build an aggregated report at the root, or build individual reports.
Default value is: false.
User property is: aggregate.
excludeFromFailureFile String 3.0 File that lists classes and rules to be excluded from failures For PMD, this is a properties file For CPD, this is a text file that contains comma-separated lists of classes that are allowed to duplicate
User property is: pmd.excludeFromFailureFile.
printFailingErrors boolean 3.0 Print details of errors that cause build failure
Default value is: false.
User property is: pmd.printFailingErrors.
skip boolean 2.0 Skip the PMD checks. Most useful on the command line via "-Dpmd.skip=true".
Default value is: false.
User property is: pmd.skip.
verbose boolean 2.0 Print details of check failures to build output.
Default value is: false.
User property is: pmd.verbose.

Parameter Details

aggregate:

Whether to build an aggregated report at the root, or build individual reports.
  • Type: boolean
  • Since: 2.2
  • Required: No
  • User Property: aggregate
  • Default: false

excludeFromFailureFile:

File that lists classes and rules to be excluded from failures For PMD, this is a properties file For CPD, this is a text file that contains comma-separated lists of classes that are allowed to duplicate
  • Type: java.lang.String
  • Since: 3.0
  • Required: No
  • User Property: pmd.excludeFromFailureFile

failOnViolation:

Whether to fail the build if the validation check fails.
  • Type: boolean
  • Since: 2.0
  • Required: Yes
  • User Property: pmd.failOnViolation
  • Default: true

failurePriority:

What priority level to fail the build on. Failures at or above this level will stop the build. Anything below will be warnings and will be displayed in the build output if verbose=true. Note: Minimum Priority = 5 Maximum Priority = 0
  • Type: int
  • Since: 2.0
  • Required: Yes
  • User Property: pmd.failurePriority
  • Default: 5

printFailingErrors:

Print details of errors that cause build failure
  • Type: boolean
  • Since: 3.0
  • Required: No
  • User Property: pmd.printFailingErrors
  • Default: false

skip:

Skip the PMD checks. Most useful on the command line via "-Dpmd.skip=true".
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: pmd.skip
  • Default: false

targetDirectory:

The location of the XML report to check, as generated by the PMD report.
  • Type: java.io.File
  • Since: 2.0
  • Required: Yes
  • User Property: project.build.directory

verbose:

Print details of check failures to build output.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: pmd.verbose
  • Default: false