Built-In Rules
The following built-in rules ship along with the enforcer plugin:
- alwaysFail - Always fail... used to test plugin configuration.
- alwaysPass - Always passes... used to test plugin configuration.
- banDependencyManagementScope - bans all scope values except for 'import' from dependencies within the dependency management.
- banDistributionManagement - enforces that project doesn't have distributionManagement.
- banDuplicatePomDependencyVersions - enforces that the project doesn't have duplicate declared dependencies.
- banDynamicVersions - bans all dependencies requiring version resolution at build time (i.e. version ranges, placeholders
RELEASE
/LATEST
or SNAPSHOT versions). - bannedDependencies - enforces that excluded dependencies aren't included.
- bannedPlugins - enforces that specific plugins aren't included in the build.
- bannedRepositories - enforces to not include banned repositories.
- banTransitiveDependencies - enforces that project doesn't have transitive dependencies.
- dependencyConvergence - ensure all dependencies converge to the same version.
- evaluateBeanshell - evaluates a beanshell script.
- externalRules - evaluate rules from an external resource.
- reactorModuleConvergence - enforces that a multi module build follows best practice.
- requireActiveProfile - enforces one or more active profiles.
- requireEnvironmentVariable - enforces the existence of an environment variable.
- requireExplicitDependencyScope - enforces that all dependencies have an explicit scope.
- requireFileChecksum - enforces that the specified file has a certain checksum.
- requireFilesDontExist - enforces that the list of files does not exist.
- requireFilesExist - enforces that the list of files does exist.
- requireFilesSize - enforces that the list of files exists and is within a certain size range.
- requireJavaVendor - enforces the JDK vendor.
- requireJavaVersion - enforces the JDK version.
- requireMatchingCoordinates - enforces specific group ID and/or artifact ID patterns.
- requireMavenVersion - enforces the Maven version.
- requireNoRepositories - enforces to not include repositories.
- requireOS - enforces the OS / CPU Architecture.
- requirePluginVersions - enforces that all plugins have a specified version.
- requirePrerequisite - enforces that prerequisites have been specified.
- requireProfileIdsExist - enforces the existence of profiles specified on the commandline.
- requireProperty - enforces the existence and values of properties.
- requireReleaseDeps - enforces that no snapshots are included as dependencies.
- requireReleaseVersion - enforces that the artifact is not a snapshot.
- requireSnapshotVersion - enforces that the artifact is not a release.
- requireSameVersions - enforces that specific dependencies and/or plugins have the same version.
- requireTextFileChecksum - enforces that the specified text file has a certain checksum (after normalizing line separators).
- requireUpperBoundDeps - ensures that every (transitive) dependency is resolved to its specified version or higher.
You may also create and inject your own custom rules by following the maven-enforcer-rule-api instructions.