Skip to content

Spring Framework 7.0 Release Notes

Brian Clozel edited this page Nov 29, 2024 · 23 revisions

This is a preview of the Spring Framework 7.0 release, scheduled for November 2025.

Upgrading From Spring Framework 6.2

Baseline upgrades

Spring Framework 7.0 does not change the JDK baseline, expecting a JDK 17-27 compatibility range. This new generation raises its minimum requirements with the following libraries:

  • Jakarta EE 11 (Tomcat 11+)
  • Kotlin 2.x, see #33629
  • JSONassert 2.0, see #33799
  • GraalVM 23 with the new "exact reachability metadata" format.

Removed APIs

GraalVM Native applications

Spring Framework 7.0 switches to the unified reachability metadata format, being adopted by the GraalVM community. Applications contributing RuntimeHints should apply the following changes:

The resource hints syntax has changed from a java.util.regex.Pattern format to a "glob pattern" format. In practice, applications might need to change their resource hints registrations if they were using wildcards. Previously, "/files/*.ext" matched both "/files/a.ext" and "/files/folder/b.txt". The new behavior matches only the former. To match both, you will need to use "/files/**/*.ext" instead. Registration of "excludes" has been removed completely.

Registering a reflection hint for a type now implies methods, constructors and fields introspection. As a result, ExecutableMode.INTROSPECT, and all MemberCategory values except MemberCategory.INVOKE_* are being deprecated. They have no replacement, as registering a type hint is enough.

In practice, it is enough to replace this:

hints.reflection().registerType(MyType.class, MemberCategory.DECLARED_FIELDS);

By this:

hints.reflection().registerType(MyType.class);

As for MemberCategory.PUBLIC_FIELDS and MemberCategory.DECLARED_FIELDS, values were replaced by INVOKE_PUBLIC_FIELDS and INVOKE_DECLARED_FIELDS to make their original intent clearer and align with the rest of the API. Note, if you were using those values for reflection only, you can safely remove those hints in favor of a simple type hint.

More details on the related changes in #33847.

New and Noteworthy