This Week in Spring - May 16th 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? Addspring-boot-docker-compose
asdevelopmentOnly
scope in Gradle oroptinal
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 onlymain(String [])
method and then forward it to your production codemain(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 onlymain
…