Skip to content

Spring Boot 1.2 Release Notes

philwebb edited this page Sep 5, 2014 · 77 revisions

Spring Boot 1.2 Release Notes (M1)

Upgrading from Spring Boot 1.1

Mongo and MongoDbFactory Beans

The MongoAutoConfiguration class will no longer register a Mongo bean if you define your own MongoDbFactory bean. Ensure that you either register a Mongo bean whenever you declare your own MongoDbFactory bean, or that you only use the MongoDbFactory interface to access Mongo databases.

Renamed VanillaHealthIndicator class

The VanillaHealthIndicator class has been renamed to ApplicationHealthIndicator. Most users will not interact with the class directly, however, if you previously imported org.springframework.boot.actuate.health.VanillaHealthIndicator in your code you will need to change it to org.springframework.boot.actuate.health.ApplicationHealthIndicator.

Hibernate

The SpringNamingStrategy class has been moved to the org.springframework.boot.orm.jpa.hibernate package. The old org.springframework.boot.orm.jpa.SpringNamingStrategy remains but is deprecated and will be removed in a future release.

Health JSON

The /health actuator endpoint JSON has been slightly modified when only a single HealthIndicator is involved. You might need to update any monitoring tools if you previously queried a specific JSON path.

Spring 4.1

Spring Boot 1.2 requires Spring Framework 4.1 and is not tested for compatibility with Spring Framework 4.0.

New and Noteworthy

Version Updates

Spring Boot 1.2 builds on and requires Spring Framework 4.1. Several 3rd party dependencies have been upgraded with this release including Jackson and Joda Time.

JTA Support

Spring Boot 1.2 now supports distributed JTA transactions across multiple XA resources using either an Atomkos or Bitronix embedded transaction manager. JTA transactions are also supported when deploying to a suitable Java EE Application Server.

When a JTA environment is detected, Spring’s JtaTransactionManager will be used to manage transactions. Auto-configured JMS, DataSource and JPA beans will be upgraded to support XA transactions. You can use standard Spring idioms such as @Transactional to participate in a distributed transaction.

Additionally, general support classes are provided to make Atomkos and Bitronix easier to configure, even if you are not using @EnableAutoConfiguration. See the JTA section of the reference manual for details.

JNDI Lookups

If you are using a full Java EE Application Server you can now lookup both DataSource and JMS ConnectionFactory beans from JNDI. Use the spring.datasource.jndi-name and spring.jms.jndi-name properties in your application.properties or application.yml file.

Banner Interface

A new Banner interface has been added which can be used in combination with SpringApplication.setBanner(…​) to provide customized banner output. The use of src/main/resources/banner.txt is still recommended for simple banners, however, the new interface is useful if you need to do something fancy.

JMS Support

Auto-configuration is now provided for Spring Framework 4.1’s @JmsListener annotation. The @EnableJms annotation is also auto-configured whenever you have spring-jms.jar on your classpath.

Spring Cloud Support

Auto-configuration has been added for spring-cloud and a new spring-boot-starter-cloud POM has also been included with this release. Auto-configuration provides equivalent functionality to the @CloudScan annotation.

CLI Updates

CLI extensions can now be installed and uninstalled using the CLI itself. The spring install <maven coordinates> will grab a remote jar and install it into the CLI. spring uninstall can be used to remove a previously installed extension.

The CLI has also been updated to detect and support the @Cachable annotation.

Declarative SSL with Jetty and Tomcat

SSL can now be configured declaratively by setting the various server.ssl.* properties. Support is provided for both Tomcat and Jetty. See the reference documentation for more details.

DataSource Metrics and Health Indicator

DataSource pool metrics are now exposed via the /metrics actuator endpoint. The number of active connections and pool usage details are exposed for Tomcat, Hikari and Commons DBCP connection pools. In addition the DataSourceHealthIndicator now uses the spring.datasource.validation-query property (if it has been set) to check the health of the database.

HealthIndicator JSON

The /health actuator endpoint now returns consistent JSON regardless of the number of HealthIndicators actually involved. This makes it much easier to query the JSON for a specific item.

Conditions

The @ConditionalOnProperty annotation has been updated with new havingValue and matchIfMissing attributes. You can now use the condition to create much more complex property matching conditions. A new AnyNestedCondition class has also been added which can be used to compose other @Conditions. Finally, the @ConditionalOnBean annotation now supports types declared as a String attribute as well as a Class.

GSON Support

It is now possible to use GSON instead of Jackson to create JSON output. If you use GSON you should exclude Jackson libraries from your Maven/Gradle build. Jackson remains the default and recommended choice.

Maven Plugin

The repackage task of the spring-boot-maven-plugin can now be disabled. This can be useful if you want to use spring-boot:run but you don’t need ``Fat Jars''.

Miscellaneous

The following miscellaneous updates are also include with Spring Boot 1.2:

  • The RedisProperties class now includes a database field.

  • The RelaxedDataBinder class supports alais properties.

  • Regex expressions can now be used with all keystosanitize properties.

  • AnsiOutput can now be configured using spring.output.ansi.enabled property.

Clone this wiki locally