Skip to content

Step 1 (PR-F): Add grails-hibernate5-micronaut BOM (Micronaut BOM split)#15689

Open
jamesfredley wants to merge 4 commits into
8.0.xfrom
refactor/micronaut-bom-hibernate-split
Open

Step 1 (PR-F): Add grails-hibernate5-micronaut BOM (Micronaut BOM split)#15689
jamesfredley wants to merge 4 commits into
8.0.xfrom
refactor/micronaut-bom-hibernate-split

Conversation

@jamesfredley
Copy link
Copy Markdown
Contributor

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

  • Add grails-hibernate5-micronaut-bom (and a micronaut-hibernate5 sample app) alongside the generic grails-micronaut-bom.
  • Publish grails-micronaut-bom / grails-micronaut only when the Micronaut island is not skipped (-PskipMicronautProjects).
  • 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.

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 help configures successfully; grails-hibernate5-micronaut-bom and the micronaut-hibernate5 sample app evaluate cleanly with no missing-project or BOM-resolution errors.

Part of the Step 1 (#15654) carve-out stack.

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
Copilot AI review requested due to automatic review settings May 28, 2026 18:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-bom platform project and a micronaut-hibernate5 sample app, both gated by -PskipMicronautProjects.
  • Extend validateMicronautBom and the Micronaut override block in dependencies.gradle to 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 CompilePlugin and PropertyNameCalculator, 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.

Comment thread grails-doc/src/en/guide/conf/micronaut.adoc Outdated
Comment thread grails-doc/src/en/guide/conf/micronaut.adoc Outdated
Comment thread grails-test-examples/micronaut-hibernate5/build.gradle
Comment thread gradle/test-config.gradle Outdated
- 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
@jamesfredley jamesfredley force-pushed the refactor/micronaut-bom-hibernate-split branch from 43122f1 to 35527d8 Compare May 28, 2026 18:44
jamesfredley added a commit that referenced this pull request May 28, 2026
…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
@jamesfredley
Copy link
Copy Markdown
Contributor Author

I think this one is ready to go

Copy link
Copy Markdown
Contributor

@jdaugherty jdaugherty left a comment

Choose a reason for hiding this comment

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

This has to be merged prior to #15654 being merged.

@borinquenkid borinquenkid self-requested a review May 30, 2026 16:10
Copy link
Copy Markdown
Member

@borinquenkid borinquenkid left a comment

Choose a reason for hiding this comment

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

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 derbyclient matching derby.version by 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-bom module into the validation set and root publishing architecture (respecting the skipMicronautProjects flag).
  • dependencies.gradle: The strict version management block for grails-hibernate5-micronaut-bom sets 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-bom will 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 enforcedPlatform will 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

  1. CompilePlugin.groovy: The minor refactor to extract javaVersion into a local variable (Integer javaVersion = lookupPropertyByType(...)) before configuring JavaCompile is a nice readability improvement, though technically unrelated to the Micronaut BOM split itself.
  2. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants