Skip to content

Spring Boot 1.3.0 Full Release Notes

Phil Webb edited this page Oct 21, 2015 · 13 revisions

Spring Boot 1.3.0 Release Notes

Upgrading from Spring Boot 1.2

Gradle plugin

Dependency management

Spring Boot’s gradle plugin has been updated in this release to use the dependency management plugin. Most users should be unaffected by this change, however those who were using the versionManagement configuration to apply their own blessed versions will have to update their build scripts.

Rather than requiring a properties file to configure version management, the new plugin allows you to use a Maven bom. For example:

dependencyManagement {
    imports {
        mavenBom 'com.example:example-bom:1.0'
    }
}

Deprecations from Spring Boot 1.2

Classes, methods and properties that were deprecated in Spring Boot 1.2 have been removed in this release. Please ensure that you aren’t calling deprecated methods before upgrading.

Jackson

Spring Boot 1.2 registered any Jackson Module beans with every ObjectMapper in the application context. This made it impossible to take complete control of an ObjectMapper bean’s modules. Spring Boot 1.3 will only register Jackson Module beans with ObjectMappers that are created or configured with the auto-configured Jackson2ObjectMapperBuilder. This brings the behaviour of module configuration into line with Boot’s other Jackson configuration.

Jetty JSPs

The spring-boot-starter-jetty "Starter POM" no longer includes org.eclipse.jetty:jetty-jsp. If you are using Jetty with JSPs you will now need to directly add this dependency yourself.

Spring Security

Spring Boot 1.3 uses Spring Security 4.0. See the Spring Security documentation for information on migrating from 3.2.

Thymeleaf’s Spring Security integration

Due to the upgrade to Spring Security 4, Spring Boot 1.3 has also upgraded the dependency management and auto-configuration of Thymeleaf’s Spring Security support. The coordinates of the new artifact are org.thymeleaf.extras:thymeleaf-extras-springsecurity4. Please update your pom.xml or build.gradle accordingly.

CLI dependency management

Spring Boot 1.3 now supports the use of Maven boms to configure its dependency management in place of the properties file-based metadata. @DependencyManagementBom should be used in place of @GrabMetadata to provide the coordinates of a bom, for example @DependencyManagementBom("io.spring.platform:platform-bom:1.1.2.RELEASE").

Spring 4.2

Spring Boot 1.3 requires Spring Framework 4.2 or later and is not compatible with earlier versions.

Deprecations in Spring Boot 1.3.0 M1

  • The ConfigurableEmbeddedServletContainer setJspServletClassName and setRegisterJspServlet methods have been replaced by setJspServlet.

  • The EndpointMBean class (and subclasses) now expect an ObjectMapper to be provided to the constructor.

  • The DropwizardMetricWriter had been replaced by DropwizardMetricService.

  • @ConditionalOnMissingClass now expects the class name to be provided using the value attribute rather than name.

Property renames

The following application.properties keys have been renamed to improve consistency:

  • spring.view. to spring.mvc.view.

  • spring.pidfile to spring.pid.file

  • server.session-timeout to server.session.timeout

  • spring.oauth2. to security.oauth2.

HTTP response compression

Spring Boot 1.2 supported native response compression for Tomcat users, or compression using Jetty’s GZipFilter for users of Jetty, Tomcat, and Undertow. Motivated by the Jetty team’s deprecation of their gzip filter, Spring Boot 1.3 replaces this with support for native response compression in all three embedded containers. As a result the server.tomcat.compression. and spring.http.gzip. properties are no longer supported. The new server.compression.* properties should be used instead.

Logging

Spring specific configuration

In order to prevent double initialization Spring specific log configuration files can now be used. It’s recommended (although not required) that you rename any default log configuration files to use a -spring suffix. For example logback.xml would change to logback-spring.xml.

Initialization failures

In Spring Boot 1.2, if you specified a custom logging configuration file using logging.config and the file did not exist, it would silently fallback to using the default configuration. Spring Boot 1.3 fails due to the missing file. Similarly, if you provided a custom Logback configuration file which was malformed, Spring Boot 1.2 would fall back to its default configuration. Spring Boot 1.3 fails and reports the problems with the configuration to System.err.

Groovy templating

The GroovyTemplateProperties class now extends AbstractTemplateViewResolverProperties and provides additional configuration options. If you currently define a prefix.spring.groovy.template.prefix property to define a custom resource location you should rename it to prefix.spring.groovy.resource-loader-location.

Security for the /health endpoint

The security settings for what information is visible on the actuator /health endpoint have been tweaked a little to provide better consistency. See the HTTP health endpoint access restrictions section in the reference guide for complete details.

Deprecations in Spring Boot 1.3.0 M2

  • The protected SpringApplication.afterRefresh method that takes a String[] has been deprecated in favor of a version that takes ApplicationArguments.

Property renames

The following application.properties keys have been renamed to improve consistency:

  • servet.tomcat.accessLogEnabled to server.tomcat.accesslog.enabled

  • servet.tomcat.accessLogPattern to server.tomcat.accesslog.pattern

  • servet.undertow.accessLogDir to server.undertow.accesslog.dir

  • servet.undertow.accessLogEnabled to server.undertow.accesslog.enabled

  • servet.undertow.accessLogPattern to server.undertow.accesslog.pattern

Gradle

The Spring Boot Gradle plugin will no longer apply Gradle’s application plugin by default. If you wish to make use of the application plugin you will have to apply it in your build.gradle.

If you do not need the functionality provided by the application plugin, but were using its mainClassName or applicationDefaultJvmArgs properties then you will need to make some minor updates to your build.gradle.

The main class should now be configured using the mainClass property on the springBoot extension, for example:

springBoot {
    mainClass = 'com.example.YourApplication'
}

applicationDefaultJvmArgs should now be configured in your project’s ext block, for example:

ext {
    applicationDefaultJvmArgs = [ '-Dcom.example.property=true' ]
}

If you were configuring your project’s main class using the main property of the application plugin’s run task, you should move this configuration to the bootRun task instead:

bootRun {
    main = com.example.YourApplication
}

Exception logging

By default Spring Boot will now log the root cause of an exception first instead of the standard "root cause last". If you prefer the root cause to be last you can either set logging.exception.conversion.word=wex in your application.properties or use custom logging configuration.

Tomcat RemoteIpValve

Tomcat’s RemoteIpValve is now configured and enabled to support x-forwarded-for and x-forwarded-proto headers. If you want to disable RemoteIpValve set server.tomcat.remote-ip-header and server.tomcat.protocol-header to empty strings.

Deprecations in Spring Boot 1.3.0 M5

Property renames

The error.path property has been renamed to server.error.path. If you previously set an error.path property in your application.properties you should migrate.

Missing /templates folder errors

Spring Boot applications no longer fail to start when a /templates folder cannot be found. If you are using a supported templating technology, and you forget to add /templates, a warning is now logged instead.

MVC Stacktrace output

Stacktrace information is now never included when Spring MVC renders an error response. If you want Spring Boot 1.2 behavior set error.include-stacktrace to on-trace-param.

Tomcat session storage

By default tomcat no longer saves session data in /tmp. If you want to use persistent sessions with Tomcat set the server.session.persistent property to true. The server.session.store-dir can be used to save files in a specific location.

Spring HATEOAS

The spring.hateoas.apply-to-primary-object-mapper property has been removed as the Spring HATEOAS auto-configuration has been reworked such that it no longer affects the context’s primary ObjectMapper. It has been replaced with a property named spring.hateoas.use-hal-as-default-json-media-type which controls whether or not the Spring HATEOAS HTTP message converter will handle requests for application/json in addition to requests for application/hal+json.

Maven spring-boot:run resources

The Spring Boot Maven plugin no longer adds src/main/resources directly to the classpath when using spring-boot:run. If you want live, in-place editing we recommend using Devtools. The addResources property can be set in your pom.xml if you want to restore Spring Boot 1.2. behavior.

New and Noteworthy

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

Version Updates

Spring Boot 1.3 builds on and requires Spring Framework 4.2. Several 3rd party dependencies have been upgraded with this release. No major upgrades have been made to the Tomcat or Jetty versions with this release.

Developer Tools

Spring Boot 1.3 includes a new spring-boot-devtools module which aims to improve the development-time experience. The module provides:

  • Sensible property defaults (for example disabling template caches)

  • Automatic application restarts

  • LiveReload support

  • Remote development support (including remote updates and remote debug via an HTTP tunnel).

See the updated documentation for more information.

Caching Auto-configuration

Auto-configuration is now provided for the following cache technologies:

  • EhCache

  • Hazelcast

  • Infinispan

  • Any compliant JCache (JSR 107) implementation

  • Redis

  • Guava

In addition, simple Map based in-memory caching is also supported. Caching is automatically configured when your application @Configuration is annotated with @EnableCaching. Cache statistics are now also exposed as an actuator endpoint (when the underlying technology allows).

For complete details see the updated documentation.

Actuator Metrics

The spring-boot-actuator metrics support has been extended to support export and aggregation. In addition, Java 8 specific GaugeService CounterService and implementations are now provided (and used when possible) which offer improved performance.

See the extended metrics documentation for details.

Fully executable JARs and service support

The Spring Boot Maven and Gradle plugins can now generate full executable archives for Linux/Unix operating systems. Furthermore you can now easily install these JARs as init.d or systemd services. Running a fully executable JAR is as easy as typing:

$ ./myapp.jar

and to install it as an init.d service:

$ sudo link -s /var/myapp/myapp.jar /etc/init.d/myapp

Additional information is available in the reference documentation.

OAuth2 Support

You can now use @EnableAuthorizationServer and @EnableResourceServer to quickly create OAuth2 authorization and resource servers. In addition, @EnableOAuth2Client allows your application to act as an OAuth2 client. For details see the overhauled security section of the reference guide.

Additional Health Indicators

Additional HealthIndicators are now provided and auto-configured for:

  • Elasticsearch

  • Email

  • JMS

CORS support for actuator endpoints

The Actuator’s endpoint now support CORS. Support is disabled by default but can be enabled by configuring endpoints.cors.allowed-origins.

Auto-configuration excludes report

The auto-configuration report (logged at the DEBUG level or available via the /autoconfig actuator endpoint) now explicitly lists configurations that have been manually excluded via @SpringBootApplication(exclude=…​) or @EnableAutoConfiguration(exclude=…​).

Validation "Starter POM"

A new spring-boot-starter-validation "starter POM" is now available to provide bean validation (JSR 303) support.

Regex support for /env and /metrics

You can now use regular expression to filter the /env and /metrics actuator endpoints. For example http://localhost:8080/metrics/.root..

SendGrid

Auto-configuration is now provided for the SendGrid email delivery service.

Maven start/stop support and admin features

The Maven plugin now include start and stop goals. These enable applications to be started without blocking Maven (allowing other goals to operate on the application). This technique is often used to launch intergration tests from Maven.

A byproduct of this work is that a new SpringApplicationAdminMXBean interface has been added which (when enabled) allows a Spring Boot application to be controlled via JMX.

Miscellaneous

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

  • Jackson’s Java 8 module will be automatically registered when using Java 8.

  • A TransactionTemplate bean is now included as part of TransactionAutoConfiguration.

  • A MailServer bean can now be obtained via JNDI by using the spring.mail.jndi-name property.

  • You can now configure the servlet name (when using an embedded servlet container) via the server.display-name property.

  • Flyway migration strategies can now be configured via a FlywayMigrationStrategy bean.

New and Noteworthy

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

jOOQ Support

Auto-configuration is now provided for jOOQ. You can @Autowire a jOOQ DSLContext directly into your Spring Beans to create type safe database queries. Additional customization is supported via spring.jooq.* application properties.

See the "Using jOOQ" section of the reference documentation for details.

Application arguments

You can now implement the ApplicationRunner interface as an alternative to CommandLineRunner. This works in the same way but provides arguments as a ApplicationArguments interface rather than a String[]. You can also inject ApplicationArguments directly into any existing bean if you need to access the application arguments.

The ApplicationArguments interface provides convenience methods for accessing "option" and "non-option" arguments. For example:

@Autowired
public MyBean(ApplicationArguments args) {
    boolean debug = args.containsOption("debug");
    List<String> files = args.getNonOptionArgs();
    // if run with "--debug logfile.txt" debug=true, files=["logfile.txt"]
}

ANSI color banner.txt files

You can now use ANSI placeholders in your banner.txt file to produce color output. Any ${Ansi.}, ${AnsiColor.}, ${AnsiBackground.} or ${AnsiStyle.} properties will be expanded. For example

${AnsiColor.BRIGHT_GREEN}My Application
${AnsiColor.BRIGHT_YELLOW}${application.formatted-version}${AnsiColor.DEFAULT}

Default profile application.properties

The -default suffix is now considered when loading application.properties (and application.yml) files when no specific profile is active. This can be helpful when you use profiles to indicate deployment environments, for example:

File Description

application.properties

Shared properties that are always loaded

application-prod.properties

Properties loaded when the prod profile is active.

application-staging.properties

Properties loaded when the staging profile is active.

application-default.properties

Properties loaded when no profile is active.

Hypermedia for MVC actuator endpoints

Actuator HTTP endpoints are now enhanced with hypermedia links when you have Spring HATEOAS on your classpath (for example via spring-boot-starter-hateoas). A new "discovery page" is also provided with links to all actuator endpoints. Support is also provided for the HAL browser if its webjar is on the classpath.

See the "Hypermedia for MVC Endpoints" reference section for more details.

Actuator docs endpoint

A new spring-boot-actuator-docs modules is provided with Spring Boot 1.3 which allows actuator documentation to be embedded into your application. Once the modules is on your classpath you can hit /docs to get information about the actuator endpoints including a sample of the data that each endpoint returns.

New actuator endpoints

The following additional actuator endpoints have been added with Spring Boot 1.3:

Name Description

/logfile

Provides access to the log file (if one has been configured).

/flyway

Provides details of any Flyway database migrations that have been applied.

/liquibase

Provides details of any Liquibase database migrations that have been applied.

Spring Session

With Spring Session and Spring Data Redis on the classpath, web applications will now be auto-configured to store user sessions in Redis. See the accompanying sample for more information.

Spring resource chains

You can now configure basic aspects of Spring’s ResourceChainRegistration via application properties. This allows you to create unique resource names so that you can implement cache busting. The spring.resources.chain.strategy.content. properties can be used to configure fingerprinting based on the content of the resource; and spring.resources.chain.strategy.fixed. properties can be used if you want to use a "fixed version" for your fingerprint.

Logback extensions

Spring Boot 1.3 supports some new tags which can be used in your logback configuration file. To use the tags you need to first rename any logback.xml configuration to logback-spring.xml. Once your configuration file has been renamed, the following tags are available.

Tag Description

<springProfile>

Allows you to optionally include or exclude sections of configuration based on the active Spring profiles.

<springProperty>

Allows you to surface properties from the Spring Environment for use within Logback.

See the Logback extensions section of the reference documentation for more details.

HTTP Session configuration

Additional properties are now provided for session configuration. You can use server.session.* properties to configure "tracking modes" and "cookie" details.

Artemis auto-configuration

Apache Artemis was formed in 2015 when HornetQ was donated to the Apache Foundation. As of Spring Boot 1.3, Apache Artemis is fully supported and can be used in pretty much the same way as HornetQ. If you are migrating to Artemis you should rename any spring.hornetq. properties to spring.artemis..

Configuration property meta-data updates

The META-INF/spring-configuration-metadata.json file format has been updated to support a new hints attribute. This can be used by IDE developers to provided better content assist support. See the updated appendix for details.

Fully executable JARs and service support

The fully executable JAR support introduced in 1.3.0.M1 has been updated to allow .conf files to be used for customization. See the updated customizing the startup script section of the reference documentation for details.

JDBC

Spring Boot will now automatically infer the driver class name from the JDBC URL for the following databases:

  • DB2

  • Firebird

  • Teradata

Ant Support

Spring Boot now includes an AntLib module to help you create executable jars from Ant. See the "Spring Boot AntLib module" section in the reference docs.

Miscellaneous

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

  • A new SpringBootVersion class has been added (similar to SpringVersion from the core framework).

  • You can now used hamcrest matchers with OutputCapture to verify tests produce certain output.

  • You can now configure Spring Boot to use Elasticsearch non local nodes.

  • The ApplicationPidFileWriter can now throw an exception if a fail-on-write-error property is set (see the updated javadoc).

  • The Maven plugin now includes a useTestClasspath option for use with spring-boot:run.

  • Extra database heath queries are now provided for DB2 and Informix.

Clone this wiki locally