Skip to content

Forge - Grails 8 Updates around Grails Data#15944

Open
jdaugherty wants to merge 9 commits into
8.0.xfrom
feat/addHibernate7ForgeFeature
Open

Forge - Grails 8 Updates around Grails Data#15944
jdaugherty wants to merge 9 commits into
8.0.xfrom
feat/addHibernate7ForgeFeature

Conversation

@jdaugherty

@jdaugherty jdaugherty commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #15942.

Grails 8.0.0-M2 users following the documented migration path (create an app, then swap
grails-data-hibernate5grails-data-hibernate7 in build.gradle) hit an unresolvable
dependency error:

Conflicting constraints detected: Cannot find a version of 'io.smallrye:jandex' that satisfies the version constraints

The root cause is that a manually-migrated app ends up with two conflicting BOMs on the same
classpath: the default grails-bom (generated into buildSrc/buildscript regardless of the data
implementation) and grails-hibernate7-bom (pulled transitively by grails-data-hibernate7).
grails-hibernate7-bom strictly pins io.smallrye:jandex:3.2.3 while hibernate-core endorses
hibernate-platform, which requires jandex 3.3.2 — an irreconcilable strict-constraint conflict.
Notably, grails-data-hibernate7 resolves fine when the matching Hibernate 7 BOM variant is the
only Grails BOM in the graph.

Rather than requiring users to hand-edit BOMs, this PR adds first-class Hibernate 7 support to
Grails Forge so generated apps consume a consistent set of BOMs from the start:

  • New gorm-hibernate7 feature (GrailsDataHibernate7) and GormImpl.HIBERNATE7, selectable
    via create-app --data hibernate7 or --features gorm-hibernate7.
  • BOM selection matrix applied consistently to the app dependencies, the buildscript
    classpath, and the generated buildSrc:
    Data implementation Without Micronaut With Micronaut
    Hibernate 5 grails-bom grails-micronaut-bom (enforced)
    Hibernate 7 grails-hibernate7-bom grails-hibernate7-micronaut-bom (enforced)
  • database-migration now emits grails-data-hibernate7-dbmigration for Hibernate 7 apps.
  • Guard rail: selecting both gorm-hibernate5 and gorm-hibernate7 is rejected with a clear
    error (GrailsDataHibernateValidator).
  • CLI switch renamed to -d, --data with -g, --gorm retained as legacy aliases.
    GormImpl.HIBERNATE was migrated to HIBERNATE5; the selection values are now hibernate5,
    hibernate7, mongodb, and the legacy value hibernate is still accepted (handled in both the
    picocli converter and a new Micronaut TypeConverter for the Forge HTTP API).
  • Naming cleanup in Forge: feature classes renamed to match their artifacts
    (GrailsDataHibernate5, GrailsDataHibernate7, GrailsDataMongoDB) and user-facing "GORM"
    text updated to "Grails Data" (feature titles/descriptions, CLI help and error messages, OpenAPI
    schema descriptions). Feature names (gorm-hibernate5, etc.) are unchanged for compatibility.
  • Documentation: creatingProject.adoc, the create-* command reference pages, and the sample
    help output updated for the new switch, values, and legacy aliases (also fixes stale
    hibernate, mongodb, neo4j value lists).

Testing

  • New GrailsDataHibernate7Spec (12 tests): dependencies, all four BOM combinations across
    build.gradle and buildSrc, dbmigration artifact switch, mutual-exclusion validation, and
    datasource config.
  • New GormImplSpec covering GormImpl.parse, including legacy and unknown values.
  • CreateAppCommandSpec extended for --data, -d, legacy -g/--gorm, legacy hibernate
    value, and the updated invalid-value error.
  • Full grails-forge check passes, except CreateControllerCommandSpec."test app with controller",
    which requires a running Docker daemon (Testcontainers) and fails identically without this change
    when Docker is unavailable.

Contributor Checklist

Issue and Scope

  • This PR is linked to an existing issue that has been acknowledged or approved by the project team. (Unresolvable dependency jandex in grails-data-hibernate7 #15942)
  • This PR addresses the complete scope of the linked issue.
  • This PR contains a single, focused change.
  • This PR targets the correct branch for the type of change. (8.0.x — new Forge feature and CLI switch rename)

Code Quality

  • I have added or updated tests that cover the changes introduced in this PR.
  • I have verified that all existing tests pass by running ./gradlew build --rerun-tasks.
  • My code follows the project's code style guidelines.
  • This PR does not include mass reformatting, style-only changes, or large-scale refactoring
    unless it was explicitly approved in the linked issue. (Forge feature-class renames were
    requested as part of this change.)
  • If generative AI tooling was used in preparing this contribution, a quality model was used to
    ensure contributions are consistent with the project's quality standards.

Licensing and Attribution

  • All contributed code is provided under the Apache License 2.0, and new source files include
    the appropriate Apache license header.
  • I have the necessary rights to submit this contribution and confirm it is my own original work.
  • If generative AI tooling was used in preparing this contribution, I have followed the ASF
    policy on generative tooling and have properly attributed its use.
    (Prepared with assistance from Claude Code; reviewed and directed by the author.)

Documentation

  • If this PR introduces user-facing changes, I have included or updated the relevant documentation.
  • If this PR adds a new feature, I have updated the What's New section of the Grails Guide.
  • If this PR introduces breaking changes or changes that require user action during an upgrade,
    I have updated the Upgrade Notes for the corresponding version in the Grails Guide.
    (No user action required: -g, --gorm, and the hibernate value remain supported as legacy aliases.)
  • The PR description clearly explains what was changed and why.

@jdaugherty jdaugherty added this to the grails:8.0.0-M3 milestone Jul 9, 2026
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.3582%. Comparing base (05393b3) to head (e5bd4d1).

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.0.x     #15944        +/-   ##
==================================================
- Coverage     49.3625%   49.3582%   -0.0043%     
  Complexity      16777      16777                
==================================================
  Files            1986       1986                
  Lines           93336      93336                
  Branches        16337      16337                
==================================================
- Hits            46073      46069         -4     
- Misses          40134      40140         +6     
+ Partials         7129       7127         -2     

see 3 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.

@jdaugherty jdaugherty marked this pull request as ready for review July 9, 2026 17:46

Copilot AI 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.

Pull request overview

This PR updates Grails Forge to support generating Grails 8 apps configured for Grails Data + Hibernate 7, ensuring a consistent BOM selection across the main build, buildscript classpath, and generated buildSrc to avoid dependency constraint conflicts (Fixes #15942).

Changes:

  • Adds a new gorm-hibernate7 feature and GormImpl.HIBERNATE7, plus parsing/legacy handling for selection values.
  • Updates BOM selection logic (including Micronaut variants) and switches database-migration to the Hibernate 7 dbmigration artifact when appropriate.
  • Renames/aliases CLI selection flag to -d, --data (keeping -g, --gorm as legacy), and updates docs + tests accordingly.

Reviewed changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/options/GormImplSpec.groovy Adds tests for GormImpl.parse and default option behavior.
grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/GrailsDataMongoDBSpec.groovy Aligns spec class name with renamed Mongo feature class.
grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/GrailsDataHibernate7Spec.groovy Adds coverage for Hibernate 7 feature dependencies, BOM selection, dbmigration switching, and config.
grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/GrailsDataHibernate5Spec.groovy Aligns spec class name with renamed Hibernate 5 feature class.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/options/GormImplTypeConverter.java Adds Micronaut HTTP type conversion for GormImpl selection values (legacy included).
grails-forge/grails-forge-core/src/main/java/org/grails/forge/options/GormImpl.java Adds HIBERNATE5/HIBERNATE7 constants and centralized parsing with legacy value support.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/migration/DatabaseMigrationPlugin.java Switches dbmigration artifact ID based on Hibernate 7 presence.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/grails/GrailsBase.java Implements BOM selection matrix (standard vs Micronaut; Hibernate 5 vs 7) for app + buildscript.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/TestContainers.java Updates Mongo feature reference to renamed Grails Data MongoDB class.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/SQLServer.java Updates constructor injection to renamed Hibernate 5 feature class.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/PostgreSQL.java Updates constructor injection to renamed Hibernate 5 feature class.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/MySQL.java Updates constructor injection to renamed Hibernate 5 feature class.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/H2.java Ensures H2 defaulting applies to both Hibernate 5 and Hibernate 7 selections.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/GraphqlGorm.java Renames dependencies/text from “GORM” to “Grails Data” and updates default persistence feature wiring.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/GrailsDataMongoDB.java Renames Mongo feature class and updates titles/descriptions and selection logic.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/GrailsDataHibernateValidator.java Adds mutual-exclusion validation for Hibernate 5 vs 7 feature selection.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/GrailsDataHibernate7.java Introduces Hibernate 7 feature: deps, datasource config defaults, and selection predicate.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/GrailsDataHibernate5.java Renames Hibernate 5 feature class and updates selection logic to avoid clashing with Hibernate 7.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/DatabaseDriverFeature.java Updates default ORM feature wiring for DB driver features (constructor injection rename).
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/DatabaseDriverConfigurationFeature.java Updates static import to renamed Hibernate 5 feature constant.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/build/gradle/templates/buildSrcBuildGradle.rocker.raw Applies BOM selection matrix to generated buildSrc Gradle build.
grails-forge/grails-forge-core/src/main/java/org/grails/forge/analytics/Generated.java Updates error message terminology to “Grails Data implementation”.
grails-forge/grails-forge-cli/src/test/groovy/org/grails/forge/cli/command/CreateAppCommandSpec.groovy Extends CLI tests for --data/-d and legacy alias behavior + message updates.
grails-forge/grails-forge-cli/src/main/java/org/grails/forge/cli/command/GormImplConverter.java Centralizes parsing and updates CLI invalid-value error message.
grails-forge/grails-forge-cli/src/main/java/org/grails/forge/cli/command/CreateCommand.java Renames CLI option to -d, --data while keeping -g, --gorm as legacy aliases.
grails-forge/grails-forge-api/src/main/java/org/grails/forge/api/ServletImplDTO.java Fixes incorrect schema description text.
grails-forge/grails-forge-api/src/main/java/org/grails/forge/api/SelectOptionsDTO.java Updates schema description terminology to “Grails Data implementation”.
grails-forge/grails-forge-api/src/main/java/org/grails/forge/api/GormImplDTO.java Updates schema descriptions to “Grails Data implementation”.
grails-doc/src/en/ref/Command Line/help.adoc Updates help output to show --data and new valid values (+ legacy alias note).
grails-doc/src/en/ref/Command Line/create-web-plugin.adoc Updates docs from --gorm to --data and refreshes valid value list.
grails-doc/src/en/ref/Command Line/create-restapi.adoc Updates docs from --gorm to --data and refreshes valid value list.
grails-doc/src/en/ref/Command Line/create-plugin.adoc Updates docs and example command from --gorm to --data.
grails-doc/src/en/ref/Command Line/create-app.adoc Updates Forge CLI docs to reference --data and new values.
grails-doc/src/en/guide/introduction/whatsNew.adoc Adds release note entry for Hibernate 7 app generation and --data flag.
grails-doc/src/en/guide/commandLine/interactiveMode.adoc Updates interactive help output for --data and new values (+ legacy alias note).
grails-doc/src/en/guide/commandLine/gradleBuild/gradlePlugins.adoc Updates --gorm mention to --data.
grails-doc/src/en/guide/commandLine/creatingProject.adoc Updates project creation docs for --data, values, and feature list (adds gorm-hibernate7).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Do not auto-add the Hibernate 5 feature from database driver features
  when another Grails Data implementation (Hibernate 7 or MongoDB) is
  already selected
- Validate the Hibernate 5/7 mutual exclusion after feature processing
  as well as before
- Guard against null input in GormImplTypeConverter
- Restore System.out/System.err after each CreateAppCommandSpec test

Copilot AI 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.

Pull request overview

Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.

Copilot AI 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.

Pull request overview

Copilot reviewed 38 out of 38 changed files in this pull request and generated 8 comments.

Comment thread grails-doc/src/en/ref/Command Line/help.adoc
Comment thread grails-doc/src/en/ref/Command Line/create-web-plugin.adoc Outdated
Comment thread grails-doc/src/en/ref/Command Line/create-restapi.adoc Outdated
Comment thread grails-doc/src/en/ref/Command Line/create-plugin.adoc Outdated
Comment thread grails-doc/src/en/ref/Command Line/create-plugin.adoc
An unknown gorm/data query parameter value now produces a 400 with a
clear message instead of silently generating an app with the default
implementation. The feature filter endpoints keep their existing
lenient fallback behavior for consistency with the other filter
options.

Copilot AI 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.

Pull request overview

Copilot reviewed 41 out of 41 changed files in this pull request and generated no new comments.

@testlens-app

testlens-app Bot commented Jul 9, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: e5bd4d1
▶️ Tests: 12859 executed
⚪️ Checks: 60/60 completed


Learn more about TestLens at testlens.app.

codeconsole pushed a commit to codeconsole/grails-core that referenced this pull request Jul 9, 2026
The build_grails job in the Groovy joint validation workflow does a full
uncached rebuild of grails-core with tests and can exhaust the ~14GB of
free disk on hosted runners (PR apache#15944 died mid-build with 'No space
left on device'). Reclaim space up front by removing unused preinstalled
toolchains, matching the existing 'Maximize build space' step used in
gradle.yml and the release workflows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unresolvable dependency jandex in grails-data-hibernate7

2 participants