Skip to content

Commit 6d5f20e

Browse files
committed
Merge remote-tracking branch 'origin/8.0.x' into grails8-groovy5-sb4
# Conflicts: # grails-doc/src/en/guide/upgrading/upgrading80x.adoc
2 parents 037d565 + f39f856 commit 6d5f20e

13 files changed

Lines changed: 192 additions & 36 deletions

File tree

grails-doc/src/en/guide/conf/micronaut.adoc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ Here's an example build file:
3232
.build.gradle
3333
----
3434
dependencies {
35-
// enforcedPlatform is required: it forces grails-bom-managed versions over the
36-
// versions declared by the Micronaut platform (e.g. javaparser-core, Groovy 4),
35+
// enforcedPlatform is required: it forces the selected Grails Micronaut BOM versions over the
36+
// versions declared by the Micronaut platform (for example Groovy 5 and javaparser-core),
3737
// preventing binary incompatibilities at runtime.
3838
implementation enforcedPlatform("org.apache.grails:grails-micronaut-bom:$grailsVersion")
3939
4040
implementation 'org.apache.grails:grails-micronaut'
4141
}
4242
----
4343

44-
The `grails-micronaut-bom` layers Micronaut-specific dependency overrides on top of `grails-bom` and pins the `io.micronaut.platform:micronaut-platform` version it was built against. Applying it as `enforcedPlatform` makes all of its constraints strictly versioned so that no transitive dependency (including Micronaut's own platform) can override them — there is no need to set a `micronautPlatformVersion` Gradle property. See link:{versionsRef}Grails%20BOM%20Micronaut.html[Grails Micronaut BOM Dependencies] for the full list of managed versions.
44+
The `grails-micronaut-bom` layers Micronaut-specific dependency overrides on top of `grails-bom` and pins the `io.micronaut.platform:micronaut-platform` version it was built against. Applying it as `enforcedPlatform` makes all of its constraints strictly versioned so that no transitive dependency, including Micronaut's own platform, can override them. There is no need to set a `micronautPlatformVersion` Gradle property. See link:{versionsRef}Grails%20BOM%20Micronaut.html[Grails Micronaut BOM Dependencies] for the full list of managed versions.
4545

4646
==== Hibernate-Specific Micronaut BOMs
4747

@@ -80,12 +80,13 @@ The Micronaut auto-setup defaults to on. If a project deliberately deviates from
8080
.build.gradle
8181
----
8282
grails {
83-
micronautAutoSetup = false // not recommended also skips the bootJar/bootWar CLASSIC loader configuration
83+
micronautAutoSetup = false // not recommended - also skips Micronaut BOM validation
8484
}
8585
----
8686

87-
WARNING: Disabling auto-setup is rarely appropriate. Without `enforcedPlatform`, Gradle's default conflict resolution allows the Micronaut platform to silently override grails-bom-managed versions of libraries such as Groovy and `javaparser-core`, leading to binary incompatibilities at runtime. The CLASSIC loader configuration that auto-setup provides is also required for `java -jar` compatibility with the Micronaut-Spring integration.
87+
WARNING: Disabling auto-setup is rarely appropriate. Without auto-setup, the Grails Gradle plugin will not validate that a Micronaut-compatible BOM is applied as `enforcedPlatform`. Without `enforcedPlatform`, Gradle's default conflict resolution allows the Micronaut platform to silently override the selected Grails Micronaut BOM versions of libraries such as Groovy and `javaparser-core`, leading to binary incompatibilities at runtime.
8888

8989
==== Generated Applications
9090

91-
Applications generated by https://forge.grails.org/[Grails Forge] with the Micronaut feature selected automatically use `enforcedPlatform("org.apache.grails:grails-micronaut-bom:$grailsVersion")` and require no further setup.
91+
Applications generated by https://forge.grails.org/[Grails Forge] with the Micronaut feature selected automatically use `enforcedPlatform("org.apache.grails:grails-micronaut-bom:$grailsVersion")` and require no further setup.
92+
In Grails 8, Micronaut-enabled applications require JDK 25 or later; applications that do not use Micronaut continue to use the standard Java 21 baseline.

grails-doc/src/en/guide/introduction/whatsNew.adoc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ This release focuses on enhancing the developer experience, improving performanc
2727
For detailed information on how to upgrade to Grails {grailsMajorVersion}, including major dependency changes, please see the xref:upgrading#upgrading80x[Upgrading from Grails 7 to Grails {grailsMajorVersion}] section.
2828
Notable new features are included below.
2929

30+
==== Platform Baseline
31+
32+
Grails {grailsMajorVersion} raises the standard build and runtime baseline to Java 21 and uses Gradle {gradleVersion}.
33+
The standard Grails BOM remains on Groovy {groovyVersion} and Spock {spockVersion}, while Micronaut-enabled Grails applications use Micronaut-specific BOM variants that align with Micronaut 5 and require JDK 25 or later.
34+
35+
==== Spring Boot 4.1 and Spring Framework 7
36+
37+
Grails {grailsMajorVersion} is built on Spring Boot {springBootVersion} and Spring Framework {springVersion}.
38+
This brings the Spring Boot 4 modular artifact layout, Spring Framework 7 API removals, Jackson 3, Tomcat 11 and Jakarta Servlet 6.1, plus Spring Boot 4.1 dependency management for Spring Security 7.1, Spring Data 2026.0 and Micrometer 1.17.
39+
40+
The Grails 8 upgrade guide calls out the major application-impacting changes and links to the Spring Boot 4.0 migration guide, Spring Boot 4.1 release notes and Spring Framework 7.0 release notes.
41+
3042
==== GSP Tag Library Improvements
3143

3244
Grails {grailsMajorVersion} continues the move toward method-based TagLib handlers while preserving compatibility with existing closure-based tags.
@@ -90,4 +102,3 @@ A single property can likewise declare a `$text` index — or another special ty
90102
When the options of an already-created index change between restarts, GORM now reconciles the difference instead of only
91103
logging a conflict. A changed TTL is applied in place with MongoDB's `collMod` command — no drop, no rebuild — while any
92104
other option change is applied by declaring `indexAttributes: [recreateOnConflict: true]`.
93-

grails-doc/src/en/guide/introduction/whatsNew/dependencyUpgrades.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ under the License.
1919

2020
Grails {version} ships with the following foundational dependency versions:
2121

22+
* Java 21 minimum baseline
2223
* Groovy {groovyVersion}
2324
* Spring Framework {springVersion}
2425
* Spring Boot {springBootVersion}
2526
* Gradle {gradleVersion}
2627
* Spock {spockVersion}
2728
29+
See the link:{versionsRef}Grails%20BOM.html[Grails BOM dependency table] for the complete managed dependency set, including the Hibernate and Micronaut BOM variants.

grails-doc/src/en/guide/upgrading/upgrading80x.adoc

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,18 @@ Grails 8 requires a minimum of Java 21 to both build and run Grails applications
4444
This is an increase from Grails 7, which required Java 17.
4545
Update your project's toolchain, CI pipelines, and deployment environments to use JDK 21 or later.
4646

47-
==== 2. Spring Boot 4.0.x
47+
==== 2. Spring Boot 4.1.x
4848

49-
Grails 8 upgrades from Spring Boot 3.5.x to Spring Boot 4.0.x.
50-
This is a major upgrade that brings Spring Framework 7.0.x, new module structure, and several breaking changes.
49+
Grails 8 upgrades from Spring Boot 3.5.x to Spring Boot 4.1.x.
50+
This crosses the Spring Boot 4 major release boundary and adopts the Spring Boot 4.1 managed stack used by Grails 8: Spring Framework 7.0.x, Spring Security 7.1.x, Spring Data 2026.0.x, Micrometer 1.17.x, Jackson 3.1.x, Tomcat 11.0.x, and Jakarta Servlet 6.1.
51+
The upgrade includes the Spring Boot 4 module split, removed Spring Framework 6 deprecations, and additional Spring Boot 4.1 removals of APIs and properties that were deprecated in Spring Boot 4.0.
5152

5253
For full details, consult:
5354

54-
1. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Release-Notes[Spring Boot 4.0 Release Notes]
55-
2. https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-7.x[Upgrading to Spring Framework 7]
55+
1. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide[Spring Boot 4.0 Migration Guide]
56+
2. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Release-Notes[Spring Boot 4.0 Release Notes]
57+
3. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.1-Release-Notes[Spring Boot 4.1 Release Notes]
58+
4. https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-7.0-Release-Notes[Spring Framework 7.0 Release Notes]
5659

5760
==== 3. Spring Boot Autoconfigure Modularization
5861

@@ -253,9 +256,10 @@ tasks.withType(BootArchive).configureEach {
253256
* The `grails-micronaut` plugin continues to work with Spring Boot 4's default loader.
254257
If you experience issues running your Micronaut-enabled Grails application via `java -jar`, please report them to the https://github.com/apache/grails-core/issues[Grails issue tracker].
255258

256-
===== 7.2 enforcedPlatform Required for grails-bom
259+
===== 7.2 enforcedPlatform Required for Micronaut BOMs
257260

258-
When using Micronaut, the `grails-bom` **must** be applied as `enforcedPlatform` instead of `platform`.
261+
When using Micronaut, select a Micronaut-compatible Grails BOM and apply it as `enforcedPlatform` instead of `platform`.
262+
The default choice is `grails-micronaut-bom`; Hibernate-specific variants are covered in section 7.4.
259263
The Micronaut 5 platform declares its own managed dependency versions that conflict with those managed by the `grails-bom`.
260264
Without `enforcedPlatform`, Gradle's default conflict resolution (highest version wins) allows the Micronaut platform to silently override `grails-bom` versions, leading to binary incompatibilities at runtime.
261265

@@ -265,22 +269,22 @@ For example, without `enforcedPlatform`:
265269
* **Spock** is upgraded from 2.3-groovy-4.0 to 2.4-groovy-5.0 -- compiled against Groovy 5, incompatible with Groovy 4 classes
266270
* **Kotlin**, **Mockito**, **Byte Buddy** are upgraded to versions not tested with the Grails stack
267271

268-
Using `enforcedPlatform` makes all `grails-bom` constraints strictly versioned so they cannot be overridden by any transitive dependency.
272+
Using `enforcedPlatform` makes the selected Micronaut BOM constraints strictly versioned so they cannot be overridden by any transitive dependency.
269273

270-
The Grails Gradle Plugin will error at configuration time if `grails-micronaut` is detected and `grails-bom` is not applied as `enforcedPlatform`.
274+
The Grails Gradle Plugin will error at configuration time if `grails-micronaut` is detected and no Micronaut-compatible Grails BOM is applied as `enforcedPlatform`.
271275

272276
[source,groovy]
273277
.build.gradle
274278
----
275279
dependencies {
276280
// enforcedPlatform is required when using grails-micronaut
277-
implementation enforcedPlatform("org.apache.grails:grails-bom:$grailsVersion")
281+
implementation enforcedPlatform("org.apache.grails:grails-micronaut-bom:$grailsVersion")
278282
279283
implementation 'org.apache.grails:grails-micronaut'
280284
}
281285
----
282286

283-
NOTE: Applications generated by the Grails Forge automatically use `enforcedPlatform` when the Micronaut feature is selected.
287+
NOTE: Applications generated by the Grails Forge automatically use the appropriate Micronaut BOM as `enforcedPlatform` when the Micronaut feature is selected.
284288

285289
===== 7.3 Micronaut Features Require JDK 25
286290

@@ -360,7 +364,7 @@ If you need to restore the legacy behavior temporarily, the deprecated marshalle
360364
==== 9. Jackson 3 is the New Default
361365

362366
Spring Boot 4 ships Jackson 3 (`tools.jackson.*`) and auto-configures a `JsonMapper` bean instead of the Jackson 2 `ObjectMapper`.
363-
Grails 8 follows that change: any Grails module that previously declared `com.fasterxml.jackson.core:jackson-databind` (Jackson 2) now declares `tools.jackson.core:jackson-databind` (Jackson 3, currently 3.1.0 via the Spring Boot 4 BOM).
367+
Grails 8 follows that change: any Grails module that previously declared `com.fasterxml.jackson.core:jackson-databind` (Jackson 2) now declares `tools.jackson.core:jackson-databind` (Jackson 3.1.x via the Spring Boot 4.1 BOM).
364368

365369
**What stayed the same:**
366370

@@ -400,7 +404,7 @@ Spring Boot 4 provides a `tools.jackson.databind.json.JsonMapper` bean instead o
400404
Update injection points to expect `JsonMapper`.
401405

402406
**If you must stay on Jackson 2 temporarily:**
403-
Spring Boot 4 still manages the Jackson 2 BOM (currently 2.21.2) and provides an opt-in toggle so the auto-configured mapper preserves Jackson 2 defaults:
407+
Spring Boot 4 still manages the Jackson 2 BOM and provides an opt-in toggle so the auto-configured mapper preserves Jackson 2 defaults:
404408

405409
[source,yaml]
406410
.application.yml
@@ -764,12 +768,24 @@ If your application *directly* uses `@Retryable`, `@EnableRetry`, or `@Recover`,
764768
implementation 'org.springframework.retry:spring-retry'
765769
----
766770

767-
NOTE: The `grails-bom` pins a known-good Spring Retry version (`2.0.x`), so you do not need to specify a version when using `enforcedPlatform("org.apache.grails:grails-bom:$grailsVersion")`.
771+
NOTE: The `grails-bom` pins a known-good Spring Retry version (`2.0.x`), so you do not need to specify a version when your build uses the Grails BOM, whether it is auto-applied by the Grails Gradle plugin or declared explicitly.
768772
Override the BOM-managed version in your build if you need a newer release.
769773

770774
==== 20. Other Default Behavior Changes
771775

772-
Spring Boot 4 made several smaller default-behavior changes that you may notice but rarely require code changes:
776+
Spring Boot 4.0 and 4.1 made several smaller default-behavior changes that you may notice but rarely require code changes:
777+
778+
* **Spring Boot 4.1 removes Spring Boot 4.0 deprecations.**
779+
If you tested against an earlier Grails 8 snapshot or Spring Boot 4.0.x directly, remove any use of APIs, methods, or configuration properties that were only deprecated there before moving to the current Grails 8 line.
780+
781+
* **The Spring Boot `BuildInfo` task writes `META-INF/build-info.properties` by default.**
782+
If your build, packaging, or tests read `build-info.properties` from the root of the generated resources directory, update them to read `META-INF/build-info.properties` or configure the task's `filename` property.
783+
784+
* **Spring Data JPA repository bootstrap modes were tightened.**
785+
Grails GORM is unaffected, but applications that also use Spring Data JPA directly should review any `spring.data.jpa.repositories.bootstrap-mode` setting when moving to Spring Boot 4.1.
786+
787+
* **Derby support is deprecated in Spring Boot.**
788+
Grails does not use Derby by default, but applications that added Derby through Spring Boot auto-configuration should plan a migration to H2, HSQLDB, or another supported database.
773789

774790
* **Logback default charset is now `UTF-8`** for log files (aligning with the existing Log4j2 default).
775791
Console output uses `Console#charset()` if available, otherwise `UTF-8`.

grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsExtension.groovy

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,10 @@ class GrailsExtension {
126126
* Whether the Micronaut auto-setup should run when the `grails-micronaut` plugin is detected.
127127
* When enabled, the Grails Gradle plugin:
128128
* <ul>
129-
* <li>validates that `grails-micronaut-bom` is applied as `enforcedPlatform` and fails the build
130-
* at configuration time with an actionable error if not (`grails-micronaut-bom` is the single
131-
* source of truth for the Micronaut platform version);</li>
132-
* <li>configures the Spring Boot `bootJar`/`bootWar` tasks to use the {@code CLASSIC} loader
133-
* implementation (required for {@code java -jar} compatibility with the Micronaut-Spring
134-
* integration).</li>
129+
* <li>validates that a Micronaut-compatible Grails BOM is applied as `enforcedPlatform` and fails
130+
* the build at configuration time with an actionable error if not;</li>
131+
* <li>keeps Micronaut dependency management aligned with the Grails BOM variant selected by the
132+
* application.</li>
135133
* </ul>
136134
* Disabling this is rarely appropriate; consumer projects should normally apply the BOM as
137135
* `enforcedPlatform` so that the Micronaut platform cannot override grails-bom-managed versions.
@@ -190,7 +188,8 @@ class GrailsExtension {
190188
* </pre>
191189
*
192190
* <p>The Micronaut variants ({@code grails-micronaut-bom},
193-
* {@code grails-hibernate5-micronaut-bom}) are applied as an {@code enforcedPlatform}
191+
* {@code grails-hibernate5-micronaut-bom}, and {@code grails-hibernate7-micronaut-bom})
192+
* are applied as an {@code enforcedPlatform}
194193
* because the Micronaut platform would otherwise override their managed versions via
195194
* conflict resolution. All other BOMs are applied as a regular {@code platform}.</p>
196195
*

grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ ${importStatements}
439439
}
440440

441441
// Exactly one Grails BOM may be applied. The BOMs are split by integration
442-
// (default / hibernate5 / micronaut), so a project must select a single variant.
442+
// (default / hibernate / micronaut), so a project must select a single variant.
443443
// If the build declares a Grails BOM by hand - for example a Micronaut application
444444
// declaring enforcedPlatform(grails-micronaut-bom), or an application generated by
445445
// Grails Forge / a profile that declares platform(grails-bom) directly - honor that
@@ -450,7 +450,7 @@ ${importStatements}
450450
throw new GradleException(
451451
"Project '${project.name}' declares more than one Grails BOM (${declaredBoms.join(', ')}). " +
452452
'Exactly one Grails BOM may be applied; the BOMs are split by integration ' +
453-
'(default / hibernate5 / micronaut), so a project must select a single variant.'
453+
'(default / hibernate / micronaut), so a project must select a single variant.'
454454
)
455455
}
456456
def effectiveBom = declaredBoms.isEmpty() ? bomName : declaredBoms.first()
@@ -505,6 +505,7 @@ ${importStatements}
505505
private static final Set<String> ENFORCED_PLATFORM_BOMS = [
506506
'grails-micronaut-bom',
507507
'grails-hibernate5-micronaut-bom',
508+
'grails-hibernate7-micronaut-bom',
508509
] as Set<String>
509510

510511
/**
@@ -516,8 +517,10 @@ ${importStatements}
516517
'grails-bom',
517518
'grails-base-bom',
518519
'grails-hibernate5-bom',
520+
'grails-hibernate7-bom',
519521
'grails-micronaut-bom',
520522
'grails-hibernate5-micronaut-bom',
523+
'grails-hibernate7-micronaut-bom',
521524
] as Set<String>
522525

523526
/**
@@ -641,10 +644,10 @@ ${importStatements}
641644

642645
project.logger.lifecycle('Micronaut Support Detected for {}', project.name)
643646

644-
// Validate that grails-micronaut-bom is applied as enforcedPlatform. The BOM is now the
645-
// single source of truth for the Micronaut platform version: applying it as
646-
// enforcedPlatform pins io.micronaut.platform:micronaut-platform with a strict
647-
// constraint that no transitive can override.
647+
// Validate that a Micronaut-compatible Grails BOM is applied as enforcedPlatform. The
648+
// selected BOM is the single source of truth for the Micronaut platform version:
649+
// applying it as enforcedPlatform pins io.micronaut.platform:micronaut-platform with a
650+
// strict constraint that no transitive can override.
648651
validateMicronautBom(project)
649652

650653
}
@@ -665,7 +668,7 @@ ${importStatements}
665668
}
666669

667670
// Exactly one Grails BOM is ever applied (the BOMs are split by integration:
668-
// default / hibernate5 / micronaut). A Micronaut project selects the Micronaut
671+
// default / hibernate / micronaut). A Micronaut project selects the Micronaut
669672
// variant either by setting grails { bom = 'grails-micronaut-bom' } (auto-applied
670673
// as an enforcedPlatform by applyGrailsBom) or by opting out via grails { bom = null }
671674
// and declaring enforcedPlatform(grails-micronaut-bom) by hand. Either way the

0 commit comments

Comments
 (0)