-
Notifications
You must be signed in to change notification settings - Fork 0
Spring Boot 1.3.0 Full Release Notes
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'
}
}
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.
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.
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 Boot 1.3 uses Spring Security 4.0. See the Spring Security documentation for information on migrating from 3.2.
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.
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 Boot 1.3 requires Spring Framework 4.2 or later and is not compatible with earlier versions.
-
The
ConfigurableEmbeddedServletContainer
setJspServletClassName
andsetRegisterJspServlet
methods have been replaced bysetJspServlet
. -
The
EndpointMBean
class (and subclasses) now expect anObjectMapper
to be provided to the constructor. -
The
DropwizardMetricWriter
had been replaced byDropwizardMetricService
. -
@ConditionalOnMissingClass
now expects the class name to be provided using thevalue
attribute rather thanname
.
The following application.properties
keys have been renamed to improve consistency:
-
spring.view.
tospring.mvc.view.
-
spring.pidfile
tospring.pid.file
-
server.session-timeout
toserver.session.timeout
-
spring.oauth2.
tosecurity.oauth2.
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.
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
.
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
.
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
.
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.
-
The protected
SpringApplication.afterRefresh
method that takes aString[]
has been deprecated in favor of a version that takesApplicationArguments
.
The following application.properties
keys have been renamed to improve consistency:
-
servet.tomcat.accessLogEnabled
toserver.tomcat.accesslog.enabled
-
servet.tomcat.accessLogPattern
toserver.tomcat.accesslog.pattern
-
servet.undertow.accessLogDir
toserver.undertow.accesslog.dir
-
servet.undertow.accessLogEnabled
toserver.undertow.accesslog.enabled
-
servet.undertow.accessLogPattern
toserver.undertow.accesslog.pattern
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 }
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’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.
-
Log4JLoggingSystem
is now deprecated following Apache’s EOL declaration for log4j 1.x.
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.
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.
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
.
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.
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
.
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.
Tip
|
Check the configuration changelog for a complete overview of the changes in configuration. |
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.
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.
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.
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.
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.
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 HealthIndicators
are now provided and auto-configured for:
-
Elasticsearch
-
Email
-
JMS
The Actuator’s endpoint now support CORS. Support is disabled by default but can be enabled by configuring endpoints.cors.allowed-origins
.
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=…)
.
A new spring-boot-starter-validation
"starter POM" is now available to provide bean validation (JSR 303) support.
You can now use regular expression to filter the /env
and /metrics
actuator endpoints. For example http://localhost:8080/metrics/.root.
.
Auto-configuration is now provided for the SendGrid email delivery service.
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.
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 ofTransactionAutoConfiguration
. -
A
MailServer
bean can now be obtained via JNDI by using thespring.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.
Tip
|
Check the configuration changelog for a complete overview of the changes in configuration. |
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.
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"]
}
See Accessing application arguments for details.
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}
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 |
---|---|
|
Shared properties that are always loaded |
|
Properties loaded when the |
|
Properties loaded when the |
|
Properties loaded when no profile is active. |
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.
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.
The following additional actuator endpoints have been added with Spring Boot 1.3:
Name | Description |
---|---|
|
Provides access to the log file (if one has been configured). |
|
Provides details of any Flyway database migrations that have been applied. |
|
Provides details of any Liquibase database migrations that have been applied. |
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.
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.
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 |
---|---|
|
Allows you to optionally include or exclude sections of configuration based on the active Spring profiles. |
|
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.
Additional properties are now provided for session configuration. You can use server.session.*
properties to configure "tracking modes" and "cookie" details.
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.
.
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.
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.
Spring Boot will now automatically infer the driver class name from the JDBC URL for the following databases:
-
DB2
-
Firebird
-
Teradata
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.
The following miscellaneous updates are also include with Spring Boot 1.3:
-
A new
SpringBootVersion
class has been added (similar toSpringVersion
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 afail-on-write-error
property is set (see the updated javadoc). -
The Maven plugin now includes a
useTestClasspath
option for use withspring-boot:run
. -
Extra database heath queries are now provided for DB2 and Informix.