Skip to content

Validate Grails BOM version properties against the Spring Boot BOM - #16428

Merged
jdaugherty merged 2 commits into
8.0.xfrom
build/bom-parent-property-validation
Sep 29, 2026
Merged

jdaugherty merged 2 commits into
8.0.xfrom
build/bom-parent-property-validation

Conversation

@jdaugherty

Copy link
Copy Markdown
Contributor

Fixes #15737

Why this matters

A Grails BOM that overrides a version Spring Boot also manages has to declare that override under Spring Boot's property name. If the names differ, setting a version property gives an incorrect configuration without any error: part of the dependency family moves and the rest does not.

That was the case on 8.0.x. Several overrides used Grails-specific names for modules Spring Boot controls under a different property:

Grails BOM property Spring Boot's property for the same modules
jackson2.version jackson-2-bom.version
jackson3.version jackson-bom.version
neo4j-driver.version (grails-neo4j-bom) neo4j-java-driver.version

For example, an application following the Spring Boot documentation sets jackson-bom.version=3.1.7. Spring Boot's imported tools.jackson:jackson-bom moves every Jackson 3 module to 3.1.7. But grails-bom pins jackson-core and jackson-databind directly under jackson3.version, and a BOM's own entries win over the ones it imports. So those two stay at 3.1.6, and the application runs on a mixed Jackson 3 classpath without any warning. Setting jackson3.version instead has the opposite problem: it moves only the two pinned modules. The same applies to the Neo4j driver. The Spring Dependency Management end-to-end build already had to copy the Jackson 3 version from one property to the other by hand to stay consistent.

Nothing in the build caught this, because validateDependencyVersions only compares resolved versions and never looks at property names. The same gap let dead and redundant entries pile up:

  • kotlin.version and mockito.version were orphaned by a merge and never reached a published POM. Kotlin looked pinned below Spring Boot's version, but setting it did nothing.
  • liquibase-hibernate5.version and the Gradle BOM's jquery.version were used by no published entry.
  • The derived BOMs re-declare groovy-bom, spock-bom and asset-pipeline-bom as constraints so that enforcedPlatform consumers get them, but published them with literal versions. Overriding groovy.version did not move those constraints.

What this adds

A new build plugin, org.apache.grails.buildsrc.bom-property-validator, registers validateBomProperties on every BOM (grails-base-bom, grails-bom, grails-hibernate5-bom, grails-hibernate7-bom, grails-neo4j-bom and grails-gradle-bom). It reads the POM each BOM publishes, walks spring-boot-dependencies and the BOMs it imports using Maven's own model (MavenXpp3Reader), and fails when:

  1. A version property the BOM owns is not used by any entry it publishes. This catches dead keys, and keys whose dependency names don't reduce to them.
  2. An override of a Spring Boot managed version uses a different property name than Spring Boot's. For a module Spring Boot manages through an imported BOM, the right name is the property Spring Boot imports that BOM with, e.g. jackson-bom.version for all of tools.jackson:jackson-bom.
  3. A pin repeats the version Spring Boot already manages, which only makes the BOM larger.

It is modelled on validateDependencyVersions:

  • It is not attached to check or build.
  • CI runs it by name in its own Validate BOM Properties job (root BOMs and grails-gradle-bom), and the release workflow runs it as a separate step.
  • It has its own opt-out, -PskipBomPropertyValidation / ext.skipBomPropertyValidation = true, which is separate from skipDependencyValidation.

Fixes it drove

  • Renamed jackson2.version → jackson-2-bom.version, jackson3.version → jackson-bom.version and neo4j-driver.version → neo4j-java-driver.version, along with the dependency keys that must prefix them.

  • Removed kotlin.version, mockito.version, liquibase-hibernate5.version and the Gradle BOM's jquery.version.

  • PropertyNameCalculator now gives a platform BOM that a derived BOM re-declares as a constraint the same property as its import.

  • Documented deliberate exceptions in dependencies.gradle, each with its reason:

    List Entry Reason
    bomPropertyNameExemptions jackson2-annotations.version jackson-annotations has had no patch releases since 2.20, so it cannot share jackson-2-bom.version
    bomPropertyNameExemptions gradle-groovy.version the Gradle BOM tracks Gradle's embedded Groovy 4 line, which cannot share groovy.version with the application's Groovy 5
    bomRedundantVersionExemptions graphql-java.version intentionally equal to Spring Boot's, as the Audit dependencies.gradle overrides against Spring Boot 4.0.6 BOM #15674 tripwire for graphql-java-extended-scalars
    bomUnusedVersionExemptions maven-model.version read directly by build tooling and deliberately kept out of the published BOMs
  • Fixed the shared skip-property check: Gradle passes a -P property given without a value as an empty string, which was parsed as false, so a bare -PskipDependencyValidation never actually skipped anything.

User-facing changes

The upgrade guide (section 14) and the Grails 8 upgrade skill now state that Grails BOMs follow the upstream BOM property names. They note that an override under a name no BOM declares is silently ignored, and list the renames:

  • Grails 7's jackson.version → jackson-2-bom.version (Jackson 3, the default, uses jackson-bom.version)
  • 8.0 milestone/RC names jackson2.version, jackson3.version and neo4j-driver.version → jackson-2-bom.version, jackson-bom.version and neo4j-java-driver.version

The build guide's section on overriding managed versions also explains that one Spring Boot property now sets the version in both BOMs.

Verification

  • New specs: ValidateBomPropertiesTaskSpec (TestKit, against a local fake parent BOM with an imported BOM and a parent POM), ValidateDependencyVersionsTaskSpec, GrailsBomPropertyValidatorPluginSpec and PropertyNameCalculatorSpec, plus new cases in GradleUtilsSpec. All build-logic tests pass.
  • For each rule, the parent-BOM walk and the skip property, I broke the behaviour on purpose and confirmed a test fails.
  • On this branch, validateDependencyVersions (245 tasks), validateBomProperties (all six BOMs, including grails-gradle-bom) and validateActions pass.
  • Not run locally: the full test suite, the docs guide build and the end-to-end suite.

Several Grails BOM overrides of Spring Boot managed versions were declared under
Grails-specific property names: jackson2.version, jackson3.version and
neo4j-driver.version, where Spring Boot controls the same modules with
jackson-2-bom.version, jackson-bom.version and neo4j-java-driver.version. Setting
the property Spring Boot documents moved only the modules Grails does not pin,
silently leaving a mixed Jackson or Neo4j driver classpath; the Spring Dependency
Management end-to-end build had to copy the Jackson 3 version across by hand.

The new bom-property-validator build plugin registers validateBomProperties on
every BOM. It reads the POM the BOM publishes, walks spring-boot-dependencies and
the BOMs it imports with Maven's own model, and fails when:

- a version property the BOM owns is used by no published entry,
- an override of a Spring Boot managed version uses a different property name
  than Spring Boot does (for a module Spring Boot manages through an imported
  BOM, the property that import uses), or
- a pin repeats the version Spring Boot already manages.

Fixing what it found:

- rename jackson2.version -> jackson-2-bom.version, jackson3.version ->
  jackson-bom.version and neo4j-driver.version -> neo4j-java-driver.version
- publish the platform BOMs the derived BOMs re-declare as constraints
  (groovy-bom, spock-bom, asset-pipeline-bom) with their property instead of a
  literal version, so overriding groovy.version moves them too
- remove version keys no published entry used: kotlin.version,
  mockito.version, liquibase-hibernate5.version and the Gradle BOM's
  jquery.version
- document the deliberate exceptions, each with its reason, in
  bomUnusedVersionExemptions, bomPropertyNameExemptions and
  bomRedundantVersionExemptions

The task has its own opt-out, skipBomPropertyValidation, and runs in its own CI
job like validateDependencyVersions. A -P opt-out given without a value now
actually skips: Gradle passes it as an empty string, which the shared check
parsed as false, so a bare -PskipDependencyValidation never took effect.

The upgrade guide and the Grails 8 upgrade skill state that Grails BOMs now
follow the upstream property names, and list the renames.

Fixes #15737

@sbglasius sbglasius left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the BOM property validation changes and ran validateBomProperties on the branch; it passes. No blocking issues found.

@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.6036%. Comparing base (aa0b6c4) to head (8cfecb0).
⚠️ Report is 5 commits behind head on 8.0.x.

Files with missing lines Patch % Lines
...grails/gradle/plugin/bom/BomManagedVersions.groovy 0.0000% 9 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.0.x     #16428        +/-   ##
==================================================
+ Coverage     58.6019%   58.6036%   +0.0017%     
- Complexity      24306      24309         +3     
==================================================
  Files            2175       2175                
  Lines          107343     107345         +2     
  Branches        19567      19566         -1     
==================================================
+ Hits            62905      62908         +3     
- Misses          35580      35583         +3     
+ Partials         8858       8854         -4     
Files with missing lines Coverage Δ
...grails/gradle/plugin/bom/BomManagedVersions.groovy 14.6667% <0.0000%> (-0.1982%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codeconsole codeconsole left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the BOM property renames, publishing changes, validator, tests, and CI wiring. All 58 focused tests passed (GradleUtilsSpec, ValidateBomPropertiesTaskSpec, GrailsBomPropertyValidatorPluginSpec, ValidateDependencyVersionsTaskSpec, and PropertyNameCalculatorSpec). One validator false negative was confirmed with an isolated Gradle fixture; details inline. Broad repository validation was left to PR CI.


private String record(Dependency dependency, Map<String, String> bomProperties, String controllingProperty) {
String version = PomVersions.interpolate(dependency.version, bomProperties)
String key = PomVersions.key(dependency)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Interpolate dependency coordinates before indexing parent versions

MavenXpp3Reader leaves expressions in groupId and artifactId unresolved, but this key is stored without interpolation. This already affects BOMs imported by Spring Boot 4.1.1: Kotlin, Brave, Zipkin Reporter, and Querydsl declare managed dependencies with <groupId>${project.groupId}</groupId>. Their entries are indexed as ${project.groupId}:kotlin-stdlib, for example, so a Grails pin for org.jetbrains.kotlin:kotlin-stdlib never matches parentVersions and silently bypasses both the property-name and redundant-version checks.

I reproduced this through validateBomProperties using a local parent BOM managing ${project.groupId}:lib at ${lib.version}=1.0 and a published constraint for test:lib:1.0 under ${wrong.version}: validation succeeds. Replacing only the parent's group ID expression with literal test makes it correctly report both violations. Please interpolate the group/artifact coordinates against the effective POM properties before constructing the lookup key (and imported-BOM resolution coordinates), and cover this case in the functional spec.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed against the Spring Boot 4.1.1 tree: kotlin-bom, brave-bom, zipkin-reporter-bom and querydsl-bom write their own group as ${project.groupId}. Fixed in 8cfecb0: PomVersions.key now interpolates the group and artifact IDs against the POM's effective properties, both for the lookup key and for the coordinates an imported BOM is resolved with.

The walk also now fails the task, naming the entry and the BOM, when it cannot resolve a parent entry's coordinates or version, instead of skipping it - that silent skip is what hid this. All 1963 entries across the 48 BOMs Spring Boot 4.1.1 pulls in resolve, so nothing fails today.

ValidateBomPropertiesTaskSpec covers it: the fixture's parent BOM now imports its family BOM as ${project.groupId}:family-bom, the family BOM manages ${project.groupId}:family-api, and a pin of test:family-api under the wrong property at the parent's version reports both violations. Separate features cover the published POM's own coordinates and an unresolvable parent entry. The same gap in the application-side BomManagedVersions is fixed too.

@bito-code-review

Copy link
Copy Markdown

The requested change to interpolate dependency coordinates before indexing parent versions is already addressed by the logic in PropertyNameCalculator.groovy and the associated validation improvements in this PR. The PR introduces validateBomProperties to enforce property usage and naming conventions, ensuring that BOM property overrides correctly align with upstream (Spring Boot) property names and that all version keys are actively used. The PropertyNameCalculator has been updated to correctly handle platform imports, ensuring that derived BOMs correctly inherit and map property names from imported platforms.

build-logic/docs-core/src/main/groovy/org/apache/grails/gradle/tasks/bom/PropertyNameCalculator.groovy

// a derived BOM re-declares the platforms it imports as plain constraints, which must carry
        // the same property as the import so that overriding it moves both
        String coordinates = "$groupId:$artifactId:$version" as String
        if (!isPlatform && !definitions.containsKey(coordinates) && platformDefinitions.containsKey(coordinates)) {
            return calculate(groupId, artifactId, version, true)
        }

        Map<String, ExtractedDependencyConstraint> toSearch = isPlatform ? platformDefinitions : definitions as Map<String, ExtractedDependencyConstraint>
        Map<String, String> coordinateMapping = isPlatform ? keysToPlatformCoordinates : keysToCoordinates

        ExtractedDependencyConstraint found = toSearch.get(coordinates)

@codeconsole codeconsole left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for the confirmed validator false negative described in the inline review: parent BOM dependency coordinates containing property references are indexed without interpolation, allowing incorrect property names and redundant pins to bypass validation. Please interpolate those coordinates and add a functional regression test. All 58 focused tests passed, but the isolated reproducer demonstrates this uncovered case.

@matrei matrei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at head d199bb475b. The base is 8.0.x at aa0b6c49e3, which is also the merge-base, so the PR is up to date and merges cleanly.

What I ran locally:

  • build-logic: :build-logic:test and :grails-docs-core:test with cleanTest --no-build-cache. All 249 plugin tests and 50 docs-core tests pass, including ValidateBomPropertiesTaskSpec (20), GradleUtilsSpec (22), ValidateDependencyVersionsTaskSpec (6), GrailsBomPropertyValidatorPluginSpec (3) and PropertyNameCalculatorSpec (7).
  • ./gradlew validateBomProperties at the root (all five BOMs) and in grails-gradle (grails-gradle-bom) passes.
  • The check fails on the real BOMs when it should. In dependencies.gradle I put back jackson3.version and neo4j-driver.version, re-added kotlin.version and mockito.version, and set logback.version to Boot's 1.5.38. grails-base-bom then reported the two orphaned keys, ${jackson3.version} should be ${jackson-bom.version} for tools.jackson.core:jackson-core/-databind, and logback.version = 1.5.38 as redundant. grails-neo4j-bom also reported ${neo4j-driver.version} should be ${neo4j-java-driver.version}.

Findings

1. ${project.groupId} coordinates: I agree with @codeconsole, and the Gradle plugin has the same gap

I reproduced @codeconsole's finding. Given a parent BOM that manages ${project.groupId}:lib at ${lib.version}, ParentBomVersions.resolve records the key as ${project.groupId}:lib, so a Grails pin of test:lib never matches it. The key is built from the raw groupId at ParentBomVersions.groovy:109, and the import coordinates at :102 have the same problem. In Spring Boot 4.1.1 this affects most of four imported BOMs:

Imported BOM Entries written as ${project.groupId}
kotlin-bom 2.3.21 23 of 25
brave-bom 6.3.1 39 of 43
zipkin-reporter-bom 3.5.3 11 of 15
querydsl-bom 5.1.0 22 of 23

None of the published Grails BOMs pin a module from these families today, so nothing slips through yet. The fix is small, though, and a validator should not let these through, so I'd fix it in this PR. PomVersions.properties already provides project.groupId, so interpolating groupId/artifactId against bomProperties before building the key is enough.

BomManagedVersions in grails-gradle-plugins, the resolver behind the bom-property-overrides plugin that applications use, has the same gap at BomManagedVersions.groovy:452, and it matters more there. With the same fixture and ext['lib.version'] = '2.0', BomManagedVersions.resolve returns:

[${project.groupId}:lib:2.0, test:other:2.0]

The literal test:other entry is overridden. The ${project.groupId} entry becomes a strict constraint on a coordinate no module has, so it changes nothing. In a Grails 8 application, kotlin.version=… in gradle.properties therefore moves only 2 of the 25 Kotlin modules, and kotlin-stdlib isn't one of them. The same goes for brave.version, zipkin-reporter.version and querydsl.version. The Gradle plugin bug predates this PR. But the upgrade note this PR adds says that "the property names in the Spring Boot documentation work unchanged in a Grails build" (upgrading80x.adoc:567), and for these four families they currently don't. Either fix BomManagedVersions the same way here, or open an issue for it and soften that sentence until it is fixed.

The two resolvers now duplicate the same Maven walk (own entries before imports, parent-chain properties, interpolation), and this bug shows they can drift apart. I understand why build-logic can't depend on grails-gradle-plugins. It would still help for each class to reference the other in its Javadoc, so a fix to one gets made in the other.

2. The rename table should cover Spring Boot 3's jackson-bom.version

In Spring Boot 3.5 (Grails 7), jackson-bom.version is the Jackson 2 property: spring-boot-dependencies-3.5.x imports com.fasterxml.jackson:jackson-bom:${jackson-bom.version} (2.19.2 in 3.5.5). In Spring Boot 4 it selects tools.jackson:jackson-bom, and Jackson 2 moved to jackson-2-bom.version. A Grails 7 build that followed the Spring Boot docs may well have jackson-bom.version=2.x in gradle.properties.

With this PR that value now also reaches the two Jackson 3 modules grails-bom pins itself (dependencies.gradle:202-203). BomManagedVersions resolves every ${...} against the project's properties first (BomManagedVersions.groovy:450), so the override becomes a strict constraint on tools.jackson.core:jackson-core:2.x, a version that does not exist. On 8.0.x today the same setting is silently dropped: the tools.jackson:jackson-bom:2.x import fails to resolve and is only logged at INFO (BomManagedVersions.groovy:378). I worked this out from the code rather than running it in an app.

Failing the build is arguably better than ignoring the setting, but the Could not find tools.jackson.core:jackson-core:2.19.2 error doesn't tell anyone to rename the property. upgrading80x.adoc already has a Grails 7 → Grails 8 table right here (line 572), so a row there would cover it:

| `jackson-bom.version` (Spring Boot 3's name for Jackson 2)
| `jackson-2-bom.version`. In Grails 8, `jackson-bom.version` sets Jackson 3, so a 2.x value there makes the build fail.

The skill table (grails-8-upgrade/SKILL.md:81) would need the same row.

3. The advice for a module the parent writes literally can't be followed

When Spring Boot writes a module's version literally (all of its own org.springframework.boot:* entries), parentImportProperty (ValidateBomPropertiesTask.groovy:121-136) reports a Grails override as ${lib-literal.version} should be ${spring-boot.version} and says to rename the version key. That fix doesn't work. Writing the pin as ${spring-boot.version} gives it Boot's version, and then the redundancy rule flags it. The only real options are to drop the pin or exempt it. Nothing hits this today, and the spec encodes the current wording (ValidateBomPropertiesTaskSpec.groovy:193). A separate message for this case would save the next person some confusion, e.g.:

org.springframework.boot:spring-boot-foo is managed at a literal version by the parent BOM and only moves with ${spring-boot.version}. Drop the pin, or add a documented exemption.

Verified as correct

  • The renamed properties match Spring Boot 4.1.1. spring-boot-dependencies-4.1.1.pom declares jackson-2-bom.version (2.21.5), jackson-bom.version (3.1.5), neo4j-java-driver.version, kotlin.version, mockito.version (5.23.0, the value the removed key held), graphql-java.version (25.0) and groovy.version. The published grails-base-bom POM now writes jackson-core/jackson-databind as ${jackson-2-bom.version} and ${jackson-bom.version}.
  • One property moves both BOMs. BomManagedVersions applies the project's properties to every BOM in the tree before each BOM's own <properties>, so the claim in gradleDependencies.adoc and the upgrade note holds for Jackson and the Neo4j driver (for the four families in finding 1, see there). Maven consumers are no worse off: grails-bom's <jackson-bom.version> does not leak into Spring Boot's import scope, the same as before.
  • No leftover references to jackson2.version, jackson3.version, the jackson2-*/jackson3-* map keys, neo4j-driver.version, kotlin.version, mockito.version or liquibase-hibernate5.version in build scripts, docs or skills. The upgrade guide's jquery.version=3.7.1 example still works, because only the Gradle BOM's copy of jquery.version was removed. liquibase-hibernate.version is the Grails 7 name too, so dropping the orphaned liquibase-hibernate5.version needs no rename row.
  • The parent walk matches Maven precedence (apart from finding 1). A BOM's own entries are recorded before its imports, and imports are walked depth first. ParentBomVersions takes only properties, not <dependencyManagement>, from a POM's <parent>. None of the BOMs spring-boot-dependencies 4.1.1 imports has a parent that manages dependencies, so nothing is missed there today.
  • Derived BOMs get the right property. The PropertyNameCalculator change gives the re-declared groovy-bom/spock-bom/asset-pipeline-bom constraints ${groovy.version} etc. instead of a literal, and the new spec pins the precedence (a plain definition wins over a platform one).
  • The isOptedOut fix is real. A bare -PskipDependencyValidation arrives as "", which Boolean.parseBoolean turned into false, so it never skipped, although the gradle-developer skill already said it did. It now skips, and ValidateDependencyVersionsTaskSpec covers the bare, =true, =false and ext forms.
  • CI. The new job uses actions/* full tags and the same gradle/actions/setup-gradle SHA as the existing jobs. Validate BOM Properties passes on the PR. No @author tags in the new files.

ExtractedDependencyConstraint calculate(String groupId, String artifactId, String version, boolean isPlatform) {
// a derived BOM re-declares the platforms it imports as plain constraints, which must carry
// the same property as the import so that overriding it moves both
String coordinates = "$groupId:$artifactId:$version" as String

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to explicitly coerce (as String) as the variable is already typed and will be implicitly coerced.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 8cfecb0.

The Kotlin, Brave, Zipkin Reporter and Querydsl BOMs that Spring Boot 4.1.1
imports write their own group as ${project.groupId}. Both BOM walkers keyed
those entries by the raw expression, so no real module ever matched them:

- validateBomProperties never checked a Grails pin of one of those modules
  against Spring Boot's property name or version
- the bom-property-overrides plugin applications use turned an override such
  as kotlin.version into a strict constraint on a module named
  ${project.groupId}:kotlin-stdlib, so it moved 2 of the 25 Kotlin modules

Group and artifact IDs are now interpolated from the BOM's own properties and
the Maven built-ins, for managed entries and imported BOMs alike. A project
property still overrides only versions, never which module an entry manages.

validateBomProperties now fails, naming the entry and the BOM, when it cannot
resolve a parent BOM entry, instead of silently leaving it unchecked. A pin of a
version the parent writes literally is reported on its own: only the property
the parent is imported with moves it, so there is no rename to suggest - drop
the pin or exempt it.

The upgrade guide and the Grails 8 upgrade skill add Spring Boot 3's
jackson-bom.version, which selected Jackson 2, to the rename table: in Grails 8
it selects Jackson 3.

@jdaugherty jdaugherty left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matrei thanks for the thorough review. All three findings are addressed in 8cfecb0:

  1. ${project.groupId} coordinates - fixed in both walkers. BomManagedVersions now interpolates an entry's group and artifact IDs, for managed entries and imported BOMs alike, from the BOM's own properties only: a project property overrides versions, never which module an entry manages. The bom-override-resolution fixture now writes both a managed module and the imported BOM as ${project.groupId}, and BomOverrideResolutionFunctionalSpec asserts that the override reaches org.example:grouplib and that child-bom is still re-imported. With that, the upgrade note's sentence about Spring Boot property names holds for Kotlin, Brave, Zipkin Reporter and Querydsl too, so I kept it. The two walkers now reference each other. In BomManagedVersions the note sits on the walk itself rather than in the class Javadoc, since that class is published and ParentBomVersions is not.
  2. Spring Boot 3's jackson-bom.version - added the row to the rename table in upgrading80x.adoc and to the Grails 8 upgrade skill.
  3. Versions the parent writes literally - a pin of one is now reported in its own group, ${foo.version}, where only ${spring-boot.version} moves the parent's version, with "remove the pin and inherit the parent BOM's version, or add a documented exemption" instead of the rename advice.

The as String you flagged is gone as well.

@codeconsole the false negative is fixed; details in your thread.

Verified locally: build-logic (302 tests), grails-gradle-plugins (313 tests and codeStyle), and validateBomProperties on all five root BOMs and grails-gradle-bom.


private String record(Dependency dependency, Map<String, String> bomProperties, String controllingProperty) {
String version = PomVersions.interpolate(dependency.version, bomProperties)
String key = PomVersions.key(dependency)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed against the Spring Boot 4.1.1 tree: kotlin-bom, brave-bom, zipkin-reporter-bom and querydsl-bom write their own group as ${project.groupId}. Fixed in 8cfecb0: PomVersions.key now interpolates the group and artifact IDs against the POM's effective properties, both for the lookup key and for the coordinates an imported BOM is resolved with.

The walk also now fails the task, naming the entry and the BOM, when it cannot resolve a parent entry's coordinates or version, instead of skipping it - that silent skip is what hid this. All 1963 entries across the 48 BOMs Spring Boot 4.1.1 pulls in resolve, so nothing fails today.

ValidateBomPropertiesTaskSpec covers it: the fixture's parent BOM now imports its family BOM as ${project.groupId}:family-bom, the family BOM manages ${project.groupId}:family-api, and a pin of test:family-api under the wrong property at the parent's version reports both violations. Separate features cover the published POM's own coordinates and an unresolvable parent entry. The same gap in the application-side BomManagedVersions is fixed too.

ExtractedDependencyConstraint calculate(String groupId, String artifactId, String version, boolean isPlatform) {
// a derived BOM re-declares the platforms it imports as plain constraints, which must carry
// the same property as the import so that overriding it moves both
String coordinates = "$groupId:$artifactId:$version" as String

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 8cfecb0.

@codeconsole codeconsole left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the follow-up changes in 8cfecb0. The coordinate interpolation fix addresses my previous request for changes, including imported BOM coordinates and the application-side BOM override resolver. The added functional coverage exercises the reported case. I reran my original isolated reproducer: it now correctly reports both the misnamed property and redundant pin. All 40 focused tests passed across ValidateBomPropertiesTaskSpec, GrailsBomPropertyValidatorPluginSpec, BomManagedVersionsSpec, BomOverrideResolutionFunctionalSpec, BomPropertyOverridesPluginSpec, and BomPropertyOverridesPluginFunctionalSpec. No new actionable findings in the follow-up diff. Broad repository validation remains with PR CI.

@testlens-app

testlens-app Bot commented Sep 29, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 8cfecb0
▶️ Tests: 89365 executed
⚪️ Checks: 90/90 completed


Learn more about TestLens at testlens.app/docs.

@jdaugherty
jdaugherty merged commit a90057b into 8.0.x Sep 29, 2026
93 checks passed
@jdaugherty
jdaugherty deleted the build/bom-parent-property-validation branch September 29, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Bom Property Validation

4 participants