-
Notifications
You must be signed in to change notification settings - Fork 40.8k
Spring Boot 1.3.0 M2 Release Notes
See instructions in the 1.3.0.M1 release notes for upgrading from v1.2.
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.
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.