VMware released the long-anticipated Spring Framework 6 and Spring Boot 3. After 5 years of Spring Framework 5, these releases begin a brand new technology for the Spring ecosystem. Spring Framework 6 requires Java 17 and Jakarta EE 9 and is appropriate with the recently released Jakarta EE 10. It additionally embeds observability by way of Micrometer with tracing and metrics. Spring Boot 3 requires Spring Framework 6. It has built-in assist for creating native executables by way of static Forward-of-Time (AOT) compilation with GraalVM Native Picture.
Michael Minella, senior director of software program engineering at VMware, advised InfoQ:
Spring has taken the method of enabling Spring builders to construct on their present experience to realize the advantages of native compilation with out vital adjustments, one thing distinctive within the ecosystem.
VMware announced Spring Framework 6 and Spring Boot 3 at its SpringOne 2021 convention. For the primary time since 2010, a Spring Framework replace adopted not one, however two years after the earlier main launch – model 5.3 in 2020. In a latest interview, Josh Lengthy, Java Champion and Spring Developer Advocate at VMware, discussing the prolonged growth time for Spring Framework 6, acknowledged:
“The migration to Jakarta EE has been difficult for us as framework builders”, “the work for observability has additionally been widespread”, and “the work for Forward-of-Time (AOT) compilation with GraalVM Native Picture […] has been within the works in some kind or one other since at the least 2019”.
For extra insights into the making of those two releases, please see the related interview with Josh Long.
Supporting Jakarta EE 10 makes Spring Framework 6 appropriate with the most recent net servers, akin to Tomcat 10.1, Jetty 11, and Undertow 2.3. Spring Framework 6 additionally simplifies HTTP requests by defining them in so-called HTTP interfaces, like Spring Information JPA simplifies database queries by way of repository interfaces. HTTP error messages are actually extra useful with RFC 7807 drawback particulars.
As a preview function, Spring Framework 6 can use the virtual threads from Project Loom on Java 19. Digital threads and the related structured concurrency API simplify concurrent programming in Java and make it extra environment friendly to run. Unlike Oracle, Spring sees digital threads complementing reactive programming, not changing it.
Notable dependency upgrades in Spring Framework 6 embrace Kotlin 1.7, Hibernate ORM 6.1, Jackson 2.14 for JSON and XML parsing, and R2DBC 1.0 for reactive database entry.
As InfoQ reported final yr, assist for the Java Platform Module System (JPMS) in Spring Framework 6 was initially deliberate however by no means got here to fruition. Nonetheless, the choice was made to delay support for JPMS:
Spring Framework 6.0 strongly focuses on AOT and GraalVM native pictures for optimizing the deployment association of Spring-based purposes. […] There have been only a few requests for it [module support] in the midst of this yr. […] Deeper module system alignment stays a part of our long-term know-how technique for the Spring Framework 6.x technology.
The OpenJDK Venture Leyden plans to optimize Java and depends on JPMS and the
jlink linking device. With out JPMS assist, Spring purposes could not use these optimizations.
The spotlight of Spring Boot 3 is assist for producing native executables. These executables begin sooner, use much less reminiscence, have smaller container pictures, and are safer. That makes Java extra aggressive within the cloud. The frameworks Quarkus, Micronaut, and Helidon made native executables common in Java. InfoQ just lately printed a six-piece article series on this subject. When the GraalVM Native Picture compiler is put in on a developer’s machine, making a native executable with Spring Boot 3 is so simple as
./mvnw -Pnative package deal or
./gradlew nativeCompile. Extra particulars could also be discovered on this blog post.
Jakarta EE 9 modified the Java namespace from
jakarta.*. This requires adjustments to present Spring and Spring Boot purposes in the event that they import Jakarta EE varieties like annotations, validations, or JPA. That is why the just lately launched Spring Boot Migrator undertaking is “engaged on [an] automated improve from Spring Boot 2.7 to Spring Boot 3.0.”
VMware shortened the industrial and open-source assist period for Spring Framework 6. As Juergen Hoeller, Spring Framework undertaking lead at VMware, put it:
The expectation is that individuals improve to the most recent 6.x function releases extra rapidly.
In distinction, the free assist period for Spring Boot 3.0 stays at one yr.
VMware will focus on its new releases at its digital SpringOne convention from January 24-26, 2023, that was originally planned as an on-site convention for December 2022.