Announcing the Gradle Enforcer Plugin

Inspired by the popular Maven Enforcer plugin I'm happy to announce that its Gradle counterpart has been released, say hello to the enforcer-gradle-plugin!

The behavior provided by Gradle Enforcer plugin is very similar to what the Maven Enforcer plugin provides, in the sense that rules will be executed during a particular phase of the build; any rule violations result in a build failure. Rules are typically setup to check for preconditions and requirements. The Maven Enforcer plugin provides a set of core rules and extra rules. In turn, the Gradle Enforcer plugin provides a similar set plus a few rules that are unique to Gradle. The following table shows rules available to both plugins:

Rule Maven Gradle
AlwaysFail
AlwaysPass
BanCircularDependencies
BanDistributionManagement
BanDuplicateClasses
BanDuplicatePomDependencyVersions
BannedDependencies
BannedPlugins
BannedRepositories
BanTransitiveDependencies
DependencyConvergence
EnforceBytecodeVersion
EvaluateBeanshell
ExcludeDependencies
ForceDependencies
ReactorModuleConvergence
RequireActiveProfile
RequireContributorRoles
RequireDeveloperRoles
RequireEncoding
RequireEnvironmentVariable
RequireFileChecksum
RequireFilesDontExist
RequireFilesExist
RequireFilesSize
RequireGradleProperty
RequireGradleVersion
RequireJavaVersion
RequireMavenVersion
RequireNoRepositories
RequireOS
RequirePluginVersions
RequirePrerequisite
RequireProfileIdsExist
RequireProperty
RequirePropertyDiverges
RequireReleaseDeps
RequireReleaseVersion
RequireSnapshotVersion
RequireSameVersions
RequireSystemProperty
RequireUpperBoundDeps

You can find more information in the plugin's guide.

Keep on coding!

Liked it? Take a second to support aalmiray on Patreon!
Become a patron at Patreon!

Trackbacks/Pingbacks

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

ˆ Back To Top