Skip to content

Commit eb85805

Browse files
committed
fix: ensure developmentOnly configuration exists with BOM platform
The Spring Dependency Management plugin previously applied BOM version constraints globally across all configurations. With the switch to Gradle's native platform(), only configurations that explicitly receive the platform dependency get managed versions. Use maybeCreate to guarantee the developmentOnly configuration always exists, even if plugin ordering changes or Spring Boot is not applied, and add the grails-bom platform to it so dependencies like spring-boot-devtools can be declared without a version. Assisted-by: Claude Code <Claude@Claude.ai>
1 parent 531041b commit eb85805

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,14 @@ ${importStatements}
386386

387387
project.dependencies.add('implementation', project.dependencies.platform(bomCoordinates))
388388

389+
// Ensure the developmentOnly configuration exists and receives BOM platform
390+
// constraints. Spring Boot's plugin normally creates this configuration, but
391+
// it does not extend from implementation so platform version constraints do
392+
// not flow to it automatically. Using maybeCreate guarantees the configuration
393+
// is available even if plugin ordering changes or Spring Boot is not applied.
394+
project.configurations.maybeCreate('developmentOnly')
395+
project.dependencies.add('developmentOnly', project.dependencies.platform(bomCoordinates))
396+
389397
project.afterEvaluate {
390398
BomManagedVersions managedVersions = BomManagedVersions.resolve(project, bomCoordinates)
391399
if (managedVersions.hasOverrides()) {

0 commit comments

Comments
 (0)