Forge - Grails 8 Updates around Grails Data#15944
Open
jdaugherty wants to merge 9 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
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-hibernate7feature andGormImpl.HIBERNATE7, plus parsing/legacy handling for selection values. - Updates BOM selection logic (including Micronaut variants) and switches
database-migrationto the Hibernate 7 dbmigration artifact when appropriate. - Renames/aliases CLI selection flag to
-d, --data(keeping-g, --gormas 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
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.
✅ All tests passed ✅🏷️ Commit: e5bd4d1 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #15942.
Grails 8.0.0-M2 users following the documented migration path (create an app, then swap
grails-data-hibernate5→grails-data-hibernate7inbuild.gradle) hit an unresolvabledependency 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 intobuildSrc/buildscriptregardless of the dataimplementation) and
grails-hibernate7-bom(pulled transitively bygrails-data-hibernate7).grails-hibernate7-bomstrictly pinsio.smallrye:jandex:3.2.3whilehibernate-coreendorseshibernate-platform, which requires jandex3.3.2— an irreconcilable strict-constraint conflict.Notably,
grails-data-hibernate7resolves fine when the matching Hibernate 7 BOM variant is theonly 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:
gorm-hibernate7feature (GrailsDataHibernate7) andGormImpl.HIBERNATE7, selectablevia
create-app --data hibernate7or--features gorm-hibernate7.buildscriptclasspath, and the generated
buildSrc:grails-bomgrails-micronaut-bom(enforced)grails-hibernate7-bomgrails-hibernate7-micronaut-bom(enforced)database-migrationnow emitsgrails-data-hibernate7-dbmigrationfor Hibernate 7 apps.gorm-hibernate5andgorm-hibernate7is rejected with a clearerror (
GrailsDataHibernateValidator).-d, --datawith-g, --gormretained as legacy aliases.GormImpl.HIBERNATEwas migrated toHIBERNATE5; the selection values are nowhibernate5,hibernate7,mongodb, and the legacy valuehibernateis still accepted (handled in both thepicocli converter and a new Micronaut
TypeConverterfor the Forge HTTP API).(
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.creatingProject.adoc, thecreate-*command reference pages, and the samplehelp output updated for the new switch, values, and legacy aliases (also fixes stale
hibernate, mongodb, neo4jvalue lists).Testing
GrailsDataHibernate7Spec(12 tests): dependencies, all four BOM combinations acrossbuild.gradleandbuildSrc, dbmigration artifact switch, mutual-exclusion validation, anddatasource config.
GormImplSpeccoveringGormImpl.parse, including legacy and unknown values.CreateAppCommandSpecextended for--data,-d, legacy-g/--gorm, legacyhibernatevalue, and the updated invalid-value error.
grails-forgecheckpasses, exceptCreateControllerCommandSpec."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
8.0.x— new Forge feature and CLI switch rename)Code Quality
./gradlew build --rerun-tasks.unless it was explicitly approved in the linked issue. (Forge feature-class renames were
requested as part of this change.)
ensure contributions are consistent with the project's quality standards.
Licensing and Attribution
the appropriate Apache license header.
policy on generative tooling and have properly attributed its use.
(Prepared with assistance from Claude Code; reviewed and directed by the author.)
Documentation
I have updated the Upgrade Notes for the corresponding version in the Grails Guide.
(No user action required:
-g,--gorm, and thehibernatevalue remain supported as legacy aliases.)