@groovy.transform.CompileStatic class BomPropertyOverridesPlugin extends java.lang.Object implements Plugin<Project>
Gradle plugin that enables Maven-style property-based version overrides
for platform() BOMs.
This is the BOM-agnostic replacement for the Spring Dependency
Management plugin's property-override feature. The plugin is shipped as
part of grails-gradle-plugins but can be applied to any project
(Grails or otherwise) that consumes a BOM published with version
property references in its <dependencyManagement> block:
plugins {
id 'org.apache.grails.gradle.bom-property-overrides'
}
dependencies {
implementation platform('com.example:my-bom:1.0.0')
}
// gradle.properties or build.gradle
ext['slf4j.version'] = '2.0.13'
platform() / enforcedPlatform()
dependencies declared on the project's configurations (configurable
via BomPropertyOverridesExtension.autoDetect).<properties> block and the
<dependencyManagement> entries, and recursively follows
<scope>import</scope> BOMs.gradle.properties or ext['property.name'])
applied, including to imported-BOM selector versions. Any artifact
whose effective version differs from its default version is recorded
as an override.require constraints contributed by
platform() even when it downgrades a managed version.The plugin does not declare any platforms itself.
Consumers (or other plugins like grails-app) remain responsible
for declaring the platform() dependencies; this plugin only
adds the property-override layer on top.
| Type | Name and description |
|---|---|
static java.lang.String |
PLUGIN_IDThe plugin id, exposed as a constant for programmatic application (e.g. |
| Constructor and description |
|---|
BomPropertyOverridesPlugin() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
apply(Project project) |
|
static void |
applyOverrides(ConfigurationContainer configurations, DependencyHandler dependencies, java.util.function.Function<java.lang.String, java.lang.String> propertyLookup, BomPropertyOverridesExtension extension)Resolves the configured BOMs and applies any version overrides found to all project configurations. |
|
static java.util.Set<java.lang.String> |
detectDeclaredBoms(ConfigurationContainer configurations)Scans every configuration for declared platform() or
enforcedPlatform() dependencies and returns their coordinates.
|
| 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) |
The plugin id, exposed as a constant for programmatic application
(e.g. project.plugins.apply(BomPropertyOverridesPlugin.PLUGIN_ID)).
Resolves the configured BOMs and applies any version overrides found to all project configurations. Takes captured Gradle services rather than a Project so that the resolve path holds no configuration-cache-hostile state. Visible for testing.
Scans every configuration for declared platform() or
enforcedPlatform() dependencies and returns their coordinates.
Takes a ConfigurationContainer rather than a Project
so the call path stays free of Project references. Visible for testing.