Spring Boot 2.0.0 M4 Release Notes

Stéphane Nicoll edited this page Oct 26, 2017 · 33 revisions

For changes in earlier milestones, please refer to:

Upgrading from Spring Boot 2.0.0 M3

See instructions in the 2.0.0.M3 release notes for upgrading from v2.0.0.M2 and earlier.

Actuator

Spring Boot 2.0 brings important changes to the Actuator: you should expect changes in the programming model, configuration keys and the response format of some endpoints. Actuator is now natively supported on Spring MVC, Spring WebFlux and Jersey.

Note
We are still working on this feature and expect some adaptation in future milestones so please reach out to us if you have trouble upgrading!

Build

The code of the Actuator has been split in two modules: the existing spring-boot-actuator and a new spring-boot-actuator-autoconfigure. If you were importing the actuator using its original module (spring-boot-actuator), please consider using the spring-boot-starter-actuator starter instead.

User-facing changes

Important user-facing changes include:

  • Spring Boot’s own metrics have been replaced with support, including auto-configuration, for Micrometer and dimensional metrics. You can learn more about Micrometer in its user manual and Spring Boot’s reference guide (#9970)

  • Endpoint’s path are no longer configurable (i.e. endpoints.<id>.path)

  • The Hypermedia support has been simplified (#9901)

  • Regex-based matching now uses query parameters rather than path variables (#9796)

  • /application/env has a new format (#9864)

  • /application/flyway has a new format (#9973)

  • /application/liquibase has a new format (#9974)

  • /application/health has a new format (#10249) and now exposes full details only. For a status-only output, a new /application/status is available (#9864)

Migrate custom endpoints

If you have custom actuator endpoints, please check out the dedicated blog post. The team also wrote a wiki page that describes how to migrate your existing Actuator endpoints to the new infrastructure.

Security

Another important change is that there is no longer a separate security auto-configuration for the Actuator:(management.security.enabled) no longer exists and web endpoints are disabled by default (endpoints.default.web.enabled) to prevent exposing sensitive information by default. The sensitive flag of each endpoint is also gone to make things more explicit in the security configuration. To restore the previous behaviour:

  1. Enable Actuator web endpoints: endpoints.default.web.enabled=true in your configuration

  2. Create or adapt your security configuration to secure endpoints with the role of your choice (see the Security section below)

Configuration

Some configuration elements have moved as well:

  • endpoints.cors to management.endpoints.cors

  • endpoints.jmx to management.endpoints.jmx

  • endpoints.health.mapping to management.health.status.http-mapping

Security

Security auto-configuration has been completely revisited: developers should read the companion blog post and refer to the Spring Boot 2.0 Security wiki page for more details about the change.

Jolokia

Jolokia is no longer an endpoint and is disabled by default for consistency with all web endpoints. Its configuration infrastructure has moved to management.jolokia. To enable Jolokia, add management.jolokia.enabled=true to your configuration.

Build

Spring Boot now requires Gradle 4.x. (#9516)

Maven projects are now compiled with the -parameters compiler flag by default. (#9323, see #9839 for Gradle support in 2.0.0.M5)

Database Migration

Liquibase and Flyway configuration keys were moved to the spring namespace (i.e. spring.liquibase and spring.flyway respectively).

Auto-configuration ordering

The default value of @AutoConfigureOrder has changed from Ordered.LOWEST_PRECEDENCE to 0. (#10142)

New and Noteworthy

Tip
Check the configuration changelog for a complete overview of the changes in configuration.

Actuator

Already covered at large in the migration part, Actuator now runs natively on Spring MVC, Spring WebFlux and Jersey. Adding the dependency and enabling web endpoints (using for instance endpoints.default.web.enabled) is all that’s required.

Configuration migration assistance

As Spring Boot 2 brings important configuration keys changes, we did our best to assist you with the migration of your configuration. Spring Boot now ships with deprecation metadata for configuration keys that were removed or relocated. Check out your favourite IDE auto-completion for extra help! (#10076)

Detection of DataSource initialization

If Flyway or Liquibase is managing the schema of your DataSource and you’re using an embedded database, Spring Boot will now automatically switch off Hibernate’s automatic DDL feature.

Database initializer

Database initialization for Spring Batch, Spring Integration, Spring Session and Quartz now occurs by default only when using and embedded database. The enabled property has been replaced with a more expressive enum. For example, if you want to always perform Spring Batch initialization you can set spring.batch.initialize-schema=always.

Parameters compilation flag

Maven-based applications using spring-boot-starter-parent use the -parameters flag by default.

Auto-configuration test utilities

A new ApplicationContextRunner test utility makes it very easy to test your auto-configurations. We’re moving all our test suite to this new model. A dedicated section in the reference documentation is expected for the next milestone.

Java 9 support

We’ve started to work on Java 9 support and full support has not been reached yet. Please report any issue you encounter with Java 9.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.