This Week in Spring - May 16th 2023

Engineering | Josh Long | May 16, 2023 | ...

My friends, Spring Boot 3.1 is nearly upon us! It drops on 18 May, in just a few short days! There are a ton of amazing features in this new release and I hope you're already trying it out (you know where). Here are some of my favorite features:

  • Built in Docker Compose support - Have a docker-compose.yml in your project root? Add spring-boot-docker-compose as developmentOnly scope in Gradle or optinal in Maven and Spring Boot will automatically run it for you on startup and shut it down on application shutdown. Here's an example
  • Built in Testcontainers support - You know Spring Boot has first class support for Testcontainers in our unit testing framework. Perhaps you've used the @DynamicPropertySource mechanism to configure the environment based on Testcontainer containers? - but this new release makes things even better. Define a test-code only main(String []) method and then forward it to your production code main(String [] args) methods. You can point that test-code only main class to new @Configuration classes, which may in turn have Testcontainer connections defined. Run that test-code only main method and Spring Boot will start that Testcontainer for you during development. You can use Devtools to fast reload code changes. You can use Devtools' @RestartScope to keep the container open across reloads, too! Now you've got the ultimate in git clone and run-able code! Here's an example.
  • Unified SSL support across the framework - Spring Boot supports SSL in all the various configured integrations where it is available, but the support for SSL was inconsistent. In the new version of Spring Boot 3.1, there is a new type called SslBundle that describes the common keys and certificates in a unified way that you can then plugin to various HTTP servers, clients, data access technologies, etc. Here are the docs where you can learn even more

Alright, friends, we've got a lot to look at this week so let's dive right into it!

Get the Spring newsletter

Stay connected with the Spring newsletter

Subscribe

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all