Skip to content

Spring Boot 1.4.0 M2 Release Notes

Phil Webb edited this page Apr 13, 2016 · 49 revisions

Spring Boot 1.4.0 M2 Release Notes

For changes in earlier milestones, please refer to:

Upgrading from Spring Boot 1.4.0 M1

See instructions in the 1.4.0.M1 release notes for upgrading from v1.3.

Test utilities and classes

Spring Boot 1.4 ships with a new spring-boot-test module that contains a completely reorganized org.springframework.boot.test package. When upgrading a Spring Boot 1.3 application you should migrate from the deprecated classes in the old package to the equivalent class in the new structure. If you’re using Linux or OSX, you can use the following command to migrate code:

find . -type f -name '*.java' -exec sed -i '' \
-e s/org.springframework.boot.test.ConfigFileApplicationContextInitializer/org.springframework.boot.test.context.ConfigFileApplicationContextInitializer/g \
-e s/org.springframework.boot.test.EnvironmentTestUtils/org.springframework.boot.test.util.EnvironmentTestUtils/g \
-e s/org.springframework.boot.test.OutputCapture/org.springframework.boot.test.rule.OutputCapture/g \
-e s/org.springframework.boot.test.SpringApplicationContextLoader/org.springframework.boot.test.context.SpringApplicationContextLoader/g \
-e s/org.springframework.boot.test.SpringBootMockServletContext/org.springframework.boot.test.mock.web.SpringBootMockServletContext/g \
-e s/org.springframework.boot.test.TestRestTemplate/org.springframework.boot.test.web.client.TestRestTemplate/g \
{} \;

Additionally, Spring Boot 1.4 attempts to rationalize and simplify the various ways that a Spring Boot test can be run. You should migrate the following to use the new @SpringBootTest annotation:

  • From @SpringApplicationConfiguration(classes=MyConfig.class) to @SpringBootTest(classes=MyConfig.class)

  • From @ContextConfiguration(classes=MyConfig.class, loader=SpringApplicationContextLoader.class) to @SpringBootTest(classes=MyConfig.class)

  • From @ContextConfiguration(classes=MyConfig.class, loader=SpringApplicationContextLoader.class) to @SpringBootTest(classes=MyConfig.class)

  • From @IntegrationTest to @SpringBootTest(webEnvironment=WebEnvironment.NONE)

  • From @IntegrationTest with @WebAppConfiguration to @SpringBootTest(webEnvironment=WebEnvironment.DEFINED_PORT) (or RANDOM_PORT)

  • From @WebIntegrationTest to @SpringBootTest(webEnvironment=WebEnvironment.DEFINED_PORT) (or RANDOM_PORT)

Tip
Whilst migrating tests you may also want to replace any @RunWith(SpringJUnit4ClassRunner.class) declarations with Spring 4.3’s more readable @RunWith(SpringRunner.class).

For more details on the @SpringBootTest annotation refer to the updated documentation.

Hibernate 5

Hibernate 5.1 is now used as the default JPA persistence provider. If you are upgrading from Spring Boot 1.3 you will be moving from Hibernate 4.3 to Hibernate 5.1. Please refer to Hibernate migration documentation for general upgrade instructions. In addition you should be aware of the following:

  • SpringNamingStrategy is no longer used as Hibernate 5.1 has removed support for the old NamingStrategy interface. A new SpringPhysicalNamingStrategy is now auto-configured which is used in combination with Hibernate’s default ImplicitNamingStrategy. This should be very close to (if not identical) to Spring Boot 1.3 defaults, however, you should check your Database schema is correct when upgrading.

  • In order to minimize upgrade pain, we set hibernate.id.new_generator_mappings is set to false for Hibernate 5. The Hibernate team generally don’t recommend this setting, so if your happy to deal with generator changes, you might want to set spring.jpa.hibernate.use-new-id-generator-mappings to true in your application.properties file.

If you have major problems upgrading to Hibernate 5.1 you can downgrade to the older Hibernate version by overriding the hibernate.version property in your pom.xml:

<properties>
	<hibernate.version>4.3.11.Final</hibernate.version>
</properties>
Note
Hibernate 4.3 will not be supported past Spring Boot 1.4. Please raise an issue if you find a bug that prevents you from upgrading.

New and Noteworthy

Spring Framework 4.3

Spring Boot 1.4 builds on and requires Spring Framework 4.3. There are a number of nice refinements in Spring Framework 4.3 including new Spring MVC @RequestMapping annotations, Refer to the Spring Framework reference documentation for details.

Third-party library upgrades

A number of third party libraries have been upgraded to the latest version. Highlights include Hibernate 5.1, Jackson 2.7, Solr 5.5, Spring Data Hopper, Spring Session 1.2 & Hazelcast 3.6.

Image Banners

banner image

Test improvements

JSON Components

Couchbase support

Narayana transaction manager support

Actuator /info improvements

  • BuildInfo stuff + full commit it info

Hibernate 5.1

MetricsFilter improvements

Caffeine cache support

Redis Spring Data repositories

Miscellaneous

  • Jetty acceptors & selectors

  • server.max-http-header-size, max-http-post-size

  • Tomcat minSpareThreads

  • Profile negation in YAML

Deprecations in Spring Boot 1.4.0

  • Velocity Deprecated

Clone this wiki locally