Step 1 (PR-F): Add grails-hibernate5-micronaut BOM (Micronaut BOM split)#15689
Conversation
Introduces a Hibernate-version-specific Micronaut BOM so Micronaut projects can target a pinned Hibernate version: - Add grails-hibernate5-micronaut-bom (and its sample app) alongside the generic grails-micronaut-bom - Publish grails-micronaut-bom / grails-micronaut only when the Micronaut island is not skipped (skipMicronautProjects) - validateMicronautBom now accepts grails-micronaut-bom and grails-hibernate5-micronaut-bom as valid enforcedPlatform BOMs - Document the Hibernate-specific Micronaut BOM usage in the Micronaut config guide and the 8.0.x upgrade notes Carved out of the Hibernate 7 Step 1 PR (#15654) so the Micronaut BOM split can be reviewed as a single topic. The Hibernate 7 variant (grails-hibernate7-micronaut-bom) is intentionally excluded here because 8.0.x does not yet contain Hibernate 7; it remains in the Step 2 branch. Assisted-by: claude-code:claude-4.7-opus
There was a problem hiding this comment.
Pull request overview
Carves the Micronaut BOM split from the Hibernate 7 stack into a focused change that introduces a Hibernate-version-specific Micronaut BOM (grails-hibernate5-micronaut-bom) alongside the generic grails-micronaut-bom, plus a matching sample app, validator/publishing wiring, and docs.
Changes:
- Add
grails-hibernate5-micronaut-bomplatform project and amicronaut-hibernate5sample app, both gated by-PskipMicronautProjects. - Extend
validateMicronautBomand the Micronaut override block independencies.gradleto cover both the generic and Hibernate-specific BOMs, with Hibernate 5 / Liquibase constraints added to the Micronaut override set. - Document the new BOM in the Micronaut config guide and the 8.0.x upgrade notes; minor refactors in
CompilePluginandPropertyNameCalculator, plus commented test-retry block in shared test config.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle | Includes new BOM and sample app in the Micronaut island |
| gradle/publish-root-config.gradle | Publishes Micronaut artifacts only when the island is enabled |
| dependencies.gradle | Extends Micronaut override block to cover the new BOM and adds Hibernate 5 / Liquibase entries |
| grails-bom/hibernate5-micronaut/build.gradle | New Hibernate 5 Micronaut BOM mirroring the generic one |
| grails-bom/micronaut/build.gradle | Comment reflow only |
| grails-gradle/plugins/.../GrailsGradlePlugin.groovy | validateMicronautBom accepts both BOMs and updates the error message |
| grails-test-examples/micronaut-hibernate5/** | New sample app consuming the Hibernate-specific BOM as enforcedPlatform |
| grails-doc/src/en/guide/conf/micronaut.adoc | Documents Hibernate-specific Micronaut BOM usage |
| grails-doc/src/en/guide/upgrading/upgrading80x.adoc | 8.0.x upgrade note for the new BOM |
| build-logic/.../CompilePlugin.groovy | Hoists javaVersion lookup out of per-task configuration |
| build-logic/.../PropertyNameCalculator.groovy | Adds prefix-based fallback to align with Spring Boot property names |
| gradle/test-config.gradle | Adds commented-out Develocity testRetry block |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Remove the broken doc link to the not-yet-generated "Grails BOM Hibernate5 Micronaut" reference page - Clarify that validateMicronautBom accepts grails-micronaut-bom or grails-hibernate5-micronaut-bom as the enforcedPlatform BOM - Register grails-hibernate5-micronaut-bom in GrailsDependencyValidatorPlugin.BOM_PROJECT_NAMES so the new sample's dependency versions are actually validated - Make the micronaut-hibernate5 startup spec assert the rendered page title instead of the always-true title || true expression - Drop the commented-out Develocity testRetry block from test-config Assisted-by: claude-code:claude-4.7-opus
43122f1 to
35527d8
Compare
…R-F #15689) Continues shrinking the PR-A review surface, matching the established B/C/D/E revert pattern. Once these land on 8.0.x and 8.0.x is merged back into this branch, the reverted changes return through the merge, so the final state of stage-hibernate7 is unchanged - only the diff visible on PR-A is reduced. Reverted content: grails.gorm.tests -> grails.gorm.specs package rename (PR #15688, PR-I) Renames the test package back to grails.gorm.tests (the 8.0.x convention) across the three affected test trees: hibernate5 core (90 files), hibernate7 core (90 files), and grails-datamapping-core-test (18 files). The mongo portion was already reverted in the prior B/C/D/E revert. Hibernate 5 Micronaut BOM split (PR #15689, PR-F) Removes grails-hibernate5-micronaut-bom, its sample app (micronaut-hibernate5), and all h5-micronaut references in settings.gradle, dependencies.gradle, publish-root-config.gradle, validateMicronautBom, the doc-generation task, and the Micronaut config/upgrade guides. The generic grails-micronaut-bom is retained. NOT reverted (intentionally kept - the actual PR-A work): - The hibernate5 -> hibernate7 baseline clone - grails-hibernate7-micronaut-bom, its sample app, and all h7 references (settings/dependencies/publish/plugin/doc-gen/guides) Verified: ./gradlew help configures cleanly; compileTestGroovy passes for grails-datamapping-core-test, grails-data-hibernate5-core, and grails-data-hibernate7-core (the three renamed trees); grails-hibernate7 -micronaut-bom still publishes. Assisted-by: claude-code:claude-4.7-opus
…om-hibernate-split Resolve conflict in grails-bom/micronaut/build.gradle: take the fuller 8.0.x comment block documenting the Groovy, Spock and Jackson 3 (tools.jackson) platform exclusions, which matches the merged exclude list in the code. Assisted-by: claude-code:claude-4.8-opus
…platform The new grails-hibernate5-micronaut-bom re-exported the Micronaut platform without excluding Jackson 3 (tools.jackson), unlike grails-micronaut-bom. As a result micronaut-platform's jackson-bom 3.1.0 leaked into the BOM's managed versions while spring-boot-dependencies (SB 4.0.6) ships 3.1.2, causing validateDependencyVersions to fail for grails-test-examples-micronaut-hibernate5 (resolved 3.1.2, expected 3.1.0). Mirror the grails-micronaut-bom exclusion so Spring Boot manages the Jackson 3 version consistently. Verified locally: :grails-test-examples-micronaut-hibernate5:validateDependencyVersions passes. Assisted-by: claude-code:claude-4.8-opus
|
I think this one is ready to go |
jdaugherty
left a comment
There was a problem hiding this comment.
This has to be merged prior to #15654 being merged.
There was a problem hiding this comment.
Overall, this is a clean and well-structured addition that successfully isolates the Hibernate 5 specific dependency management layer on top of the generic Micronaut BOM. Documentation updates are clear, and the included test example provides good verification.
Core Build & Logic Changes
- PropertyNameCalculator.groovy: The added fallback logic cleanly addresses cases like
derbyclientmatchingderby.versionby checking if an existing version property acts as a prefix for the artifact key. This aligns well with Spring Boot's BOM naming conventions. - GrailsDependencyValidatorPlugin.groovy & publish-root-config.gradle: Correctly includes the new
:grails-hibernate5-micronaut-bommodule into the validation set and root publishing architecture (respecting theskipMicronautProjectsflag). - dependencies.gradle: The strict version management block for
grails-hibernate5-micronaut-bomsets explicit bounds for Hibernate (5.6.15.Final), Liquibase (4.27.0), Groovy (5.0.5), and Spock (2.4-groovy-5.0), preventing transitive platform overrides.
Documentation & Validation
- micronaut.adoc & upgrading80x.adoc: The upgrade guides and configuration documentation accurately explain how to consume the new BOM via
enforcedPlatform. It clearly defines the forward-looking strategy:grails-micronaut-bomwill track future framework defaults while this specific BOM remains pinned to Hibernate 5. - GrailsGradlePlugin.groovy: The assertion update is excellent. Failing the build at configuration time with a distinct error message if a Micronaut project fails to declare either the generic or the Hibernate 5 specific variant as an
enforcedPlatformwill save developers a lot of debugging time.
Test Harness
- grails-test-examples/micronaut-hibernate5: The test application profile (
web), configuration, and Geb startup specification (ApplicationStartupSpec.groovy) look solid and provide immediate regression coverage for this configuration.
Minor Notes / Questions for the Author
- CompilePlugin.groovy: The minor refactor to extract
javaVersioninto a local variable (Integer javaVersion = lookupPropertyByType(...)) before configuringJavaCompileis a nice readability improvement, though technically unrelated to the Micronaut BOM split itself. - build.gradle (BOM): In
grails-bom/hibernate5-micronaut/build.gradle, there is a small typo in a string interpolation on lines 56 and 81:"$micronautPlatformVersion"has a space in the diff text ($m icronautPlatformVersion). Double-check to ensure this didn't introduce a literal space or compilation issue in the raw code.
Used Gemini as collaborator
|
@matrei we wanted confirmation from you before we merge this |
| import grails.testing.mixin.integration.Integration | ||
|
|
||
| @Integration | ||
| class ApplicationStartupSpec extends ContainerGebSpec { |
There was a problem hiding this comment.
Do we need a ContainerGebSpec for this or does it suffice with HttpClientSupport?
There was a problem hiding this comment.
HttpClientSupport would be simpler, since this is micronaut relates I am going to leave the Geb test, just in case it needs extended to prove it is working.
Brings PR-F (#15689, the grails-hibernate5-micronaut-bom split) back onto the hibernate7 staging branch and reconciles it with the hibernate7 clone. Every conflict was resolved as the union of the incoming hibernate5 variant (from 8.0.x) and the existing hibernate7 staging variant: - settings.gradle: include both grails-hibernate5/7-micronaut-bom, both micronaut-hibernate5/7 test examples, and their project dirs - dependencies.gradle: keep the grails-hibernate7-micronaut-bom BOM block and widen the main block to also cover grails-hibernate5-micronaut-bom - publish-root-config.gradle: publish grails-hibernate7-bom and both micronaut BOMs - rat-root-config.gradle: keep the hibernate5/7 build-dir excludes - GrailsDependencyValidatorPlugin: treat grails-hibernate7-bom and grails-hibernate5-micronaut-bom as BOM projects - GrailsGradlePlugin.validateMicronautBom: accept grails-micronaut-bom plus both hibernate-specific micronaut BOMs - docs (micronaut.adoc, upgrading80x.adoc): document both the hibernate5 and hibernate7 micronaut BOMs Verified with `./gradlew help`: the full project graph configures, both micronaut BOMs publish, and both micronaut-hibernate test examples pass BOM validation. Assisted-by: claude-code:claude-opus-4-8
…hibernate7 clone The grails-hibernate7-micronaut-bom clone and its micronaut-hibernate7 sample were created before PR-F (#15689) refined the hibernate5 Micronaut BOM, so two hibernate5 fixes never reached the hibernate7 clone. Merging 8.0.x back in - which added grails-hibernate7-micronaut-bom to the dependency validator's recognized BOMs - surfaced the gap. - grails-bom/hibernate7-micronaut/build.gradle: exclude tools.jackson from the re-exported Micronaut platform, mirroring 31ec106 on the hibernate5 BOM. Without it, micronaut-platform's jackson-bom (3.1.0) shadows the version spring-boot-dependencies manages (3.1.2), and :grails-test-examples-micronaut-hibernate7:validateDependencyVersions fails. Verified passing after the fix. - micronaut-hibernate7 ApplicationStartupSpec: assert the rendered page title instead of the always-true `title || true`, mirroring 35527d8. Assisted-by: claude-code:claude-opus-4-8
Brings the latest 8.0.x, including the grails-hibernate5-micronaut-bom split (#15689). Resolves the dependencies.gradle conflict in the micronaut BOM block: keeps the base's liquibase/hibernate version keys and the PR's groovy 5.0.7-SNAPSHOT pin. Assisted-by: claude-code:claude-4.8-opus
Summary
Carves the Micronaut BOM split out of the Hibernate 7 Step 1 PR (#15654) so it can be reviewed as a single, focused topic (per @matrei's review request).
This introduces a Hibernate-version-specific Micronaut BOM so Micronaut projects can target a pinned Hibernate version, rather than relying solely on the generic
grails-micronaut-bom.Changes
grails-hibernate5-micronaut-bom(and amicronaut-hibernate5sample app) alongside the genericgrails-micronaut-bom.grails-micronaut-bom/grails-micronautonly when the Micronaut island is not skipped (-PskipMicronautProjects).validateMicronautBomnow acceptsgrails-micronaut-bomandgrails-hibernate5-micronaut-bomas validenforcedPlatformBOMs.Scope note
The Hibernate 7 variant (
grails-hibernate7-micronaut-bom) is intentionally excluded here because 8.0.x does not yet contain Hibernate 7. The h7 BOM, its sample app, and the h7 platform BOM remain part of the Step 2 (8.0.x-hibernate7) branch.Verification
./gradlew helpconfigures successfully;grails-hibernate5-micronaut-bomand themicronaut-hibernate5sample app evaluate cleanly with no missing-project or BOM-resolution errors.Part of the Step 1 (#15654) carve-out stack.