Latest in branch 5.1
5.1.20
Released 09 Dec 2020
(5 years ago)
SoftwareSpring Framework
Version5.1
Supported
Java versions
Java 8+
Initial release5.1.0
21 Sep 2018
(7 years ago)
Latest release5.1.20
09 Dec 2020
(5 years ago)
End of
OSS support
Dec 2020
(Ended 5 years, 5 months ago)
End of
enterprise support
Dec 2022
(Ended 3 years, 5 months ago)
Source codehttps://github.com/spring-projects/spring-framework/tree/v5.1.20.RELEASE
Documentationhttps://docs.spring.io/spring-framework/docs/5.1.20.RELEASE/spring-framework-reference/
Spring Framework 5.1 ReleasesView full list

What Is New in Spring Framework 5.1

Spring Framework 5.1 delivers a set of refinements and new capabilities focused on core container, web stack, and data access improvements. This release builds on the foundation of 5.0 with a strong emphasis on JDK 11 compatibility and runtime performance.

Category Key Updates
Core Container Support for JDK 11, refined annotation detection, programmatic lookup support for @Named.
Web Framework JSON improvements (Jackson 2.9), Scripting (Kotlin 1.3, JRuby 9.2), Servlet 4.0 support in Spring Test.
Data Access Hibernate 5.3 support, declarative TransactionManager resolution, reactive transaction support.
Testing JUnit 5.2 support, parallel test execution, enhanced SpringBootTest context caching.
Kotlin Support Full support for Kotlin 1.3, null-safety for bean injection, coroutines in Spring MVC and WebFlux.

How does Spring Framework 5.1 improve core container performance?

The core container gets smarter annotation processing and programmatic bean lookup. Annotation detection skips non-annotated classes faster, which matters for startup time in large applications.

You can now use @Named with the standard javax.inject API for programmatic lookups via BeanFactory. This bridges Spring's powerful container with lighter, standard-based lookups when you need them.

JDK 11 Runtime Support

Spring 5.1 is fully compatible with JDK 11, the next long-term support release. In practice, this means you can run your Spring applications on the latest Java runtime without waiting for framework patches.

What web framework updates should developers know about?

The web stack receives updates across JSON serialization, scripting languages, and Servlet API support. Jackson 2.9 is now the baseline, bringing performance improvements and new module support for your REST APIs.

Scripting support moves forward with Kotlin 1.3 and JRuby 9.2. If you use JSR-223 scripts within Spring, your newer language runtimes are now officially supported.

Servlet 4.0 in Tests

Spring's mock objects for testing now support Servlet 4.0. This allows you to unit-test features like HTTP/2 push without a full container, which speeds up development cycles for modern web apps.

Are there important data access and transaction changes?

Yes, Hibernate 5.3 is now supported. This matters because it aligns Spring's ORM support with the latest Hibernate features and fixes.

Transaction management gets two key upgrades. First, you can declaratively resolve which TransactionManager to use via @Transactional. Second, reactive transaction support is more robust for non-blocking data access patterns.

@Transactional(transactionManager = "ordersTxManager")
public void processOrder() {
    // This method uses a specific transaction manager
}

What's new for testing Spring applications?

JUnit 5.2 is fully supported, including its extension model and parallel execution. You can run tests in parallel within a single JVM, which cuts down feedback time in large test suites.

SpringBootTest context caching is more efficient. When you have multiple test classes with identical configuration, Spring reuses the application context between them. This leads to significantly faster test runs in a typical Spring Boot project.

How is Kotlin support enhanced in this release?

Kotlin 1.3 is fully supported, including its new coroutines. You can now use suspending functions directly in @Controller and @RestController classes for Spring MVC and WebFlux.

Spring's null-safety annotations now apply to bean injection points. The Kotlin compiler will warn you if you inject a nullable type into a non-nullable Kotlin parameter, catching potential null pointer issues at compile time.

@Repository
class UserRepository {
    fun findById(id: Long): User?
}

@Service
class UserService(@Autowired val userRepository: UserRepository) {
    // Kotlin knows userRepository.findById() can return null
}

FAQ

Should I upgrade from Spring Framework 5.0 to 5.1?
Yes, if you're on 5.0. The upgrade path is smooth and brings performance improvements, JDK 11 support, and important library updates like Jackson and Hibernate. It's a recommended maintenance release.

Does Spring 5.1 require Java 11?
No. It supports Java 8, 9, 10, and 11. Java 11 is fully supported, but not mandatory. You can run it on Java 8.

What is the significance of programmatic @Named lookup?
It provides a standard JSR-330 way to look up beans programmatically from the BeanFactory. This is useful for integration code or frameworks that need to dynamically fetch beans by name without full @Autowired injection.

How do the testing improvements affect my Spring Boot applications?
The enhanced context caching in SpringBootTest has an immediate impact. If your Boot app has multiple integration tests with the same configuration, they will start much faster as the test framework reuses the application context.

Can I use Kotlin coroutines with Spring MVC?
Yes. Spring Framework 5.1 introduces support for Kotlin coroutines in both Spring MVC (Servlet stack) and WebFlux (Reactive stack). You can mark controller methods with the suspend keyword.

Releases In Branch 5.1

VersionRelease date
5.1.2009 Dec 2020
(5 years ago)
5.1.1927 Oct 2020
(5 years ago)
5.1.1815 Sep 2020
(5 years ago)
5.1.1721 Jul 2020
(5 years ago)
5.1.1609 Jun 2020
(6 years ago)
5.1.1528 Apr 2020
(6 years ago)
5.1.1425 Feb 2020
(6 years ago)
5.1.1314 Jan 2020
(6 years ago)
5.1.1203 Dec 2019
(6 years ago)
5.1.1102 Nov 2019
(6 years ago)
5.1.1028 Sep 2019
(6 years ago)
5.1.902 Aug 2019
(6 years ago)
5.1.813 Jun 2019
(6 years ago)
5.1.709 May 2019
(7 years ago)
5.1.631 Mar 2019
(7 years ago)
5.1.513 Feb 2019
(7 years ago)
5.1.409 Jan 2019
(7 years ago)
5.1.327 Nov 2018
(7 years ago)
5.1.229 Oct 2018
(7 years ago)
5.1.115 Oct 2018
(7 years ago)
5.1.021 Sep 2018
(7 years ago)
5.1.0.RC307 Sep 2018
(7 years ago)
5.1.0.RC217 Aug 2018
(7 years ago)
5.1.0.RC126 Jul 2018
(7 years ago)