@groovy.transform.CompileStatic class GrailsDependencyValidatorPlugin extends java.lang.Object implements Plugin<Project>
Validates that transitive dependencies do not replace versions what the BOM (grails-bom or grails-gradle-bom) defines. This covers both direct BOM constraints and inherited platform constraints (e.g., from spring-boot-dependencies).
The plugin auto-detects which BOM is in use by scanning the project's dependency declarations. Projects without a BOM are silently skipped.
Usage: Apply via CompilePlugin (automatic) or directly, then run
./gradlew validateDependencyVersions.
| Type | Name and description |
|---|---|
static java.lang.String |
ALLOWED_OVERRIDES_EXTProject ext property name that holds a collection of "group:name" keys
to exempt from version validation. |
static java.lang.String |
VALIDATE_TASK_NAME |
| Constructor and description |
|---|
GrailsDependencyValidatorPlugin() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
apply(Project project) |
|
static java.lang.String |
detectBomPath(Project project)Scans the project's configurations to find which BOM project is in use. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Project ext property name that holds a collection of "group:name" keys
to exempt from version validation. Use this when a deliberate override is applied
(e.g. via resolutionStrategy.useVersion) and the divergence from the BOM
is intentional.
Scans the project's configurations to find which BOM project is in use.
Exactly one Grails BOM is expected on a project: the BOMs are split by
integration (default / hibernate5 / micronaut), so a project selects a single
variant. This method returns the path of the one declared Grails BOM, null
when none is declared, and fails the build when more than one distinct Grails BOM
is found (which indicates a misconfiguration - e.g. layering grails-bom and
grails-micronaut-bom on the same project).
Build-tooling configurations that pull in a BOM purely to resolve their own tool
versions (see BOM_DETECTION_EXCLUDED_CONFIGURATIONS) are skipped, so the shared
documentation configuration's grails-bom does not conflict with a variant
BOM a project selects for its real dependencies.