What Is New in Spring Boot 1.2
| Category | Key Updates |
|---|---|
| New Features | Auto-configuration for Spring Data JPA, Spring Data Solr, and Spring Security. Support for JTA 1.2, JMS 2.0, and Websockets. |
| Improvements | Enhanced actuator endpoints, simplified testing with @SpringApplicationConfiguration, and better template support for FreeMarker and Groovy. |
| Deprecated | Several properties in SpringApplication have been deprecated in favor of new namespaces. |
| Bug Fixes | Numerous fixes across auto-configuration, embedded container support, and dependency management. |
How did auto-configuration get smarter in 1.2?
Spring Boot 1.2 expanded its auto-configuration magic to several new Spring modules. The most significant additions are for Spring Data JPA, Spring Data Solr, and Spring Security.
For JPA, this means automatic setup of an EntityManagerFactory and transaction management. With Security, you get a default authentication manager and a basic security chain. In practice, this slashes the boilerplate code needed to get these complex modules up and running.
What Java EE 7 support was added?
This release brought support for key Java EE 7 standards, specifically JTA 1.2 and JMS 2.0. This matters because it aligns Spring Boot with modern application server capabilities.
You can now use the simplified JMS 2.0 API for sending messages. The JTA 1.2 support ensures better integration with distributed transaction managers, which is crucial for more complex, service-based architectures.
How were the actuator endpoints improved?
The actuator got a major upgrade, becoming more customizable and powerful. New endpoints were added for database migrations (/flyway and /liquibase) and logging (/loggers).
You can now dynamically change log levels at runtime using the /loggers endpoint. The /configprops endpoint also became much more useful, showing a full list of all bound configuration properties, which is a lifesaver for debugging.
What changed for testing Spring Boot applications?
Testing was simplified with the introduction of @SpringApplicationConfiguration. This new annotation is a drop-in replacement for @ContextConfiguration and is aware of your SpringApplication setup.
It loads the ApplicationContext the same way your main application does, respecting your custom configuration. This eliminates subtle differences between your test and production contexts, making tests more reliable.
Were there any template engine updates?
Yes, support for FreeMarker and Groovy Templates was enhanced. The big change is that template extensions (.ftl, .tpl) are now hidden from the URL by default.
This is a security and cleanliness improvement. Your users see cleaner URLs, and you avoid accidentally exposing which template technology you're using behind the scenes.
FAQ
How do I upgrade my existing Spring Boot 1.1 application to 1.2?
Review the release notes for deprecated properties. Most changes are drop-in, but you'll need to rename properties like spring.data.jpa.repositories.enabled to the new spring.data.jpa.repositories.enabled namespace. Your IDE should help flag these.
Does the new JTA 1.2 support mean I need a full application server?
No. Spring Boot's embedded Tomcat, Jetty, and Undertow support still works perfectly. The JTA support is for when you connect to an external JTA transaction manager, like Atomikos.
Can I use the new Spring Security auto-configuration with OAuth?
Yes. The basic auto-configuration provides a foundation. You can then add your own WebSecurityConfigurerAdapter to customize the configuration, including setting up OAuth, without conflicting with the defaults.
What's the benefit of the new @SpringApplicationConfiguration annotation?
It ensures your tests use the same context loading mechanism as your main application, including custom SpringApplication initializers. This avoids the "test context doesn't match production" headache.
Why were my Freemarker file extensions stripped from URLs?
This is a new default behavior in 1.2 for security and cleanliness. If you need the old behavior, you can set the property spring.freemarker.suffix to your desired extension (e.g., .ftl).