enforcer:enforce

Full name:

org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce

Description:

This goal executes the defined enforcer-rules once per module.

Attributes:

  • Requires a Maven project to be executed.
  • The goal is thread-safe and supports parallel builds.
  • Binds by default to the lifecycle phase: validate.

Required Parameters

Name Type Since Description
rules EnforcerRule[] - Array of objects that implement the EnforcerRule interface to execute.

Optional Parameters

Name Type Since Description
fail boolean - Flag to fail the build if a version check fails.
Default value is: true.
User property is: enforcer.fail.
failFast boolean - Fail on the first rule that doesn't pass
Default value is: false.
User property is: enforcer.failFast.
ignoreCache boolean - Use this flag to disable rule result caching. This will cause all rules to execute on each project even if the rule indicates it can safely be cached.
Default value is: false.
User property is: enforcer.ignoreCache.
skip boolean - Flag to easily skip all checks
Default value is: false.
User property is: enforcer.skip.

Parameter Details

fail:

Flag to fail the build if a version check fails.
  • Type: boolean
  • Required: No
  • User Property: enforcer.fail
  • Default: true

failFast:

Fail on the first rule that doesn't pass
  • Type: boolean
  • Required: No
  • User Property: enforcer.failFast
  • Default: false

ignoreCache:

Use this flag to disable rule result caching. This will cause all rules to execute on each project even if the rule indicates it can safely be cached.
  • Type: boolean
  • Required: No
  • User Property: enforcer.ignoreCache
  • Default: false

rules:

Array of objects that implement the EnforcerRule interface to execute.
  • Type: org.apache.maven.enforcer.rule.api.EnforcerRule[]
  • Required: Yes

skip:

Flag to easily skip all checks
  • Type: boolean
  • Required: No
  • User Property: enforcer.skip
  • Default: false