Merge branch '2.1.x'

pull/18077/head
Phillip Webb 5 years ago
commit dc870044c6

@ -1451,19 +1451,17 @@
</resource>
</resources>
<attributes>
<spring-boot-repo>${spring-boot-repo}</spring-boot-repo>
<github-tag>${github-tag}</github-tag>
<sources-root>${project.basedir}/src</sources-root>
<asciidoc-sources-root>${project.basedir}/src/main/asciidoc</asciidoc-sources-root>
<generated-resources-root>${project.basedir}/target/generated-resources</generated-resources-root>
<spring-boot-repo>${spring-boot-repo}</spring-boot-repo>
<github-tag>${github-tag}</github-tag>
<jooq-version>${jooq.version}</jooq-version>
<spring-boot-docs-version>${revision}</spring-boot-docs-version>
<spring-boot-version>${revision}</spring-boot-version>
<spring-docs-version>${spring-framework.version}</spring-docs-version>
<spring-framework-version>${spring-framework.version}</spring-framework-version>
<spring-integration-docs-version>${spring-integration.version}</spring-integration-docs-version>
<spring-security-docs-version>${spring-security.version}</spring-security-docs-version>
<spring-webservices-docs-version>${spring-ws.version}</spring-webservices-docs-version>
<spring-integration-version>${spring-integration.version}</spring-integration-version>
<spring-security-version>${spring-security.version}</spring-security-version>
<spring-webservices-version>${spring-ws.version}</spring-webservices-version>
</attributes>
</configuration>
<executions>
@ -1620,7 +1618,7 @@
</stringutil>
<var name="github-tag" value="v${revision}" />
<propertyregex property="github-tag" override="true"
input="${github-tag}" regexp=".*SNAPSHOT" replace="master" />
input="${github-tag}" regexp=".*SNAPSHOT" replace="2.1.x" />
</target>
</configuration>
</execution>

@ -13,134 +13,78 @@
:spring-boot-repo: snapshot
:github-tag: master
:spring-boot-docs-version: current
:spring-boot-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-docs-version}/reference
:spring-boot-docs-current: https://docs.spring.io/spring-boot/docs/current/reference
:spring-boot-version: current
:github-repo: spring-projects/spring-boot
:github-raw: https://raw.github.com/{github-repo}/{github-tag}
:github-code: https://github.com/{github-repo}/tree/{github-tag}
:github-issues: https://github.com/{github-repo}/issues/
:github-wiki: https://github.com/{github-repo}/wiki
:github-master-code: https://github.com/{github-repo}/tree/master
:sc-ext: java
:sc-spring-boot: {github-code}/spring-boot-project/spring-boot/src/main/java/org/springframework/boot
:sc-spring-boot-autoconfigure: {github-code}/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
:sc-spring-boot-actuator: {github-code}/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate
:sc-spring-boot-actuator-autoconfigure: {github-code}/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure
:sc-spring-boot-cli: {github-code}/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli
:sc-spring-boot-devtools: {github-code}/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools
:sc-spring-boot-test: {github-code}/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test
:sc-spring-boot-test-autoconfigure: {github-code}/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure
:dc-ext: html
:dc-root: https://docs.spring.io/spring-boot/docs/{spring-boot-docs-version}/api
:dc-spring-boot: {dc-root}/org/springframework/boot
:dc-spring-boot-autoconfigure: {dc-root}/org/springframework/boot/autoconfigure
:dc-spring-boot-actuator: {dc-root}/org/springframework/boot/actuate
:dc-spring-boot-test: {dc-root}/org/springframework/boot/test
:dc-spring-boot-test-autoconfigure: {dc-root}/org/springframework/boot/test/autoconfigure
:dependency-management-plugin: https://github.com/spring-gradle-plugins/dependency-management-plugin
:dependency-management-plugin-documentation: {dependency-management-plugin}/blob/master/README.md
:java-javadoc: https://docs.oracle.com/javase/8/docs/api/
:spring-boot-actuator-api: https://docs.spring.io/spring-boot/docs/{spring-boot-docs-version}/actuator-api/
:spring-boot-maven-plugin-site: https://docs.spring.io/spring-boot/docs/{spring-boot-docs-version}/maven-plugin
:spring-boot-gradle-plugin: https://docs.spring.io/spring-boot/docs/{spring-boot-docs-version}/gradle-plugin
:spring-boot-gradle-plugin-reference: https://docs.spring.io/spring-boot/docs/{spring-boot-docs-version}/gradle-plugin/reference/html
:spring-reference: https://docs.spring.io/spring/docs/{spring-docs-version}/spring-framework-reference/
:spring-initializr-reference: https://docs.spring.io/initializr/docs/current/reference/html
:spring-rest-docs: https://projects.spring.io/spring-restdocs/
:spring-integration: https://projects.spring.io/spring-integration/
:spring-integration-reference: https://docs.spring.io/spring-integration/docs/{spring-integration-docs-version}/reference/html
:spring-session: https://projects.spring.io/spring-session/
:spring-framework: https://projects.spring.io/spring-framework/
:spring-security: https://projects.spring.io/spring-security/
:spring-data-elasticsearch: https://spring.io/projects/spring-data-elasticsearch
:spring-data-elasticsearch-reference: https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/
:spring-data-jpa: https://projects.spring.io/spring-data-jpa/
:spring-security-reference: https://docs.spring.io/spring-security/site/docs/{spring-security-docs-version}/reference/htmlsingle
:spring-security-oauth2-reference: https://projects.spring.io/spring-security-oauth/docs/oauth2.html
:spring-webservices-reference: https://docs.spring.io/spring-ws/docs/{spring-webservices-docs-version}/reference/
:spring-javadoc: https://docs.spring.io/spring/docs/{spring-docs-version}/javadoc-api/org/springframework
:spring-amqp-javadoc: https://docs.spring.io/spring-amqp/docs/current/api/org/springframework/amqp
:spring-batch-javadoc: https://docs.spring.io/spring-batch/apidocs/org/springframework/batch
:spring-data-javadoc: https://docs.spring.io/spring-data/jpa/docs/current/api/org/springframework/data/jpa
:spring-data-commons-javadoc: https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data
:spring-data-mongo-javadoc: https://docs.spring.io/spring-data/mongodb/docs/current/api/org/springframework/data/mongodb
:spring-data-mongo: https://projects.spring.io/spring-data-mongodb/
:spring-data: https://projects.spring.io/spring-data/
:spring-data-rest-javadoc: https://docs.spring.io/spring-data/rest/docs/current/api/org/springframework/data/rest
:gradle-userguide: https://www.gradle.org/docs/current/userguide
:ant-manual: https://ant.apache.org/manual
:code-examples: {sources-root}/main/java/org/springframework/boot/docs
:test-examples: {sources-root}/test/java/org/springframework/boot/docs
:gradle-user-guide: https://docs.gradle.org/4.2.1/userguide
:hibernate-documentation: https://docs.jboss.org/hibernate/orm/5.3/userguide/html_single/Hibernate_User_Guide.html
:jetty-documentation: https://www.eclipse.org/jetty/documentation/9.4.x
:jooq-manual: https://www.jooq.org/doc/{jooq-version}/manual-single-page
:micrometer-concepts-documentation: https://micrometer.io/docs/concepts
:micrometer-registry-documentation: https://micrometer.io/docs/registry
:tomcat-documentation: https://tomcat.apache.org/tomcat-8.5-doc
:kotlin-documentation: https://kotlinlang.org/docs/reference/
:junit5-documentation: https://junit.org/junit5/docs/current/user-guide
:spring-boot-repo: snapshot
:github-tag: master
:spring-boot-docs-version: current
:spring-boot-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-docs-version}/reference
:spring-boot-docs-current: https://docs.spring.io/spring-boot/docs/current/reference
:github-repo: spring-projects/spring-boot
:github-raw: https://raw.github.com/{github-repo}/{github-tag}
:github-code: https://github.com/{github-repo}/tree/{github-tag}
:github-issues: https://github.com/{github-repo}/issues/
:github-wiki: https://github.com/{github-repo}/wiki
:github-master-code: https://github.com/{github-repo}/tree/master
:sc-ext: java
:sc-spring-boot: {github-code}/spring-boot-project/spring-boot/src/main/java/org/springframework/boot
:sc-spring-boot-autoconfigure: {github-code}/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
:sc-spring-boot-actuator: {github-code}/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate
:sc-spring-boot-actuator-autoconfigure: {github-code}/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure
:sc-spring-boot-cli: {github-code}/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli
:sc-spring-boot-devtools: {github-code}/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools
:sc-spring-boot-test: {github-code}/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test
:sc-spring-boot-test-autoconfigure: {github-code}/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure
:dc-ext: html
:dc-root: https://docs.spring.io/spring-boot/docs/{spring-boot-docs-version}/api
:dc-spring-boot: {dc-root}/org/springframework/boot
:dc-spring-boot-autoconfigure: {dc-root}/org/springframework/boot/autoconfigure
:dc-spring-boot-actuator: {dc-root}/org/springframework/boot/actuate
:dc-spring-boot-test: {dc-root}/org/springframework/boot/test
:dc-spring-boot-test-autoconfigure: {dc-root}/org/springframework/boot/test/autoconfigure
:dependency-management-plugin: https://github.com/spring-gradle-plugins/dependency-management-plugin
:dependency-management-plugin-documentation: {dependency-management-plugin}/blob/master/README.md
:java-javadoc: https://docs.oracle.com/javase/8/docs/api/
:spring-boot-actuator-api: https://docs.spring.io/spring-boot/docs/{spring-boot-docs-version}/actuator-api/
:spring-boot-maven-plugin-site: https://docs.spring.io/spring-boot/docs/{spring-boot-docs-version}/maven-plugin
:spring-boot-gradle-plugin: https://docs.spring.io/spring-boot/docs/{spring-boot-docs-version}/gradle-plugin
:spring-boot-gradle-plugin-reference: https://docs.spring.io/spring-boot/docs/{spring-boot-docs-version}/gradle-plugin/reference/html
:spring-reference: https://docs.spring.io/spring/docs/{spring-docs-version}/spring-framework-reference/
:spring-rest-docs: https://projects.spring.io/spring-restdocs/
:spring-integration: https://projects.spring.io/spring-integration/
:spring-session: https://projects.spring.io/spring-session/
:spring-boot-code: https://github.com/{github-repo}/tree/{github-tag}
:spring-boot-api: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/api
:spring-boot-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/reference
:spring-boot-master-code: https://github.com/{github-repo}/tree/master
:spring-boot-current-docs: https://docs.spring.io/spring-boot/docs/current/reference
:spring-boot-actuator-restapi: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/actuator-api/
:spring-boot-maven-plugin-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/maven-plugin
:spring-boot-gradle-plugin-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/gradle-plugin/reference/html
:spring-boot-gradle-plugin-pdfdocs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/gradle-plugin/reference/pdf/spring-boot-gradle-plugin-reference.pdf
:spring-boot-gradle-plugin-api: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/gradle-plugin/reference/html
:spring-boot-module-code: {spring-boot-code}/spring-boot-project/spring-boot/src/main/java/org/springframework/boot
:spring-boot-module-api: {spring-boot-api}/org/springframework/boot
:spring-boot-autoconfigure-module-code: {spring-boot-code}/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
:spring-boot-autoconfigure-module-api: {spring-boot-api}/org/springframework/boot/autoconfigure
:spring-boot-actuator-module-code: {spring-boot-code}/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate
:spring-boot-actuator-module-api: {spring-boot-api}/org/springframework/boot/actuate
:spring-boot-actuator-autoconfigure-module-code: {spring-boot-code}/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure
:spring-boot-actuator-autoconfigure-module-api: : {spring-boot-api}/org/springframework/boot/actuate/autoconfigure
:spring-boot-cli-module-code: {spring-boot-code}/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli
:spring-boot-cli-module-api: {spring-boot-api}/org/springframework/boot/cli
:spring-boot-devtools-module-code: {spring-boot-code}/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools
:spring-boot-devtools-module-api: {spring-boot-api}/org/springframework/boot/devtools
:spring-boot-test-module-code: {spring-boot-code}/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test
:spring-boot-test-module-api: {spring-boot-api}/org/springframework/boot/test
:spring-boot-test-autoconfigure-module-code: {spring-boot-code}/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure
:spring-boot-test-autoconfigure-module-api: {spring-boot-api}/org/springframework/boot/test/autoconfigure
:spring-amqp-api: https://docs.spring.io/spring-amqp/docs/current/api/org/springframework/amqp
:spring-batch-api: https://docs.spring.io/spring-batch/apidocs/org/springframework/batch
:spring-data: https://projects.spring.io/spring-data/
:spring-data-commons-api: https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data
:spring-data-elasticsearch: https://spring.io/projects/spring-data-elasticsearch
:spring-data-elasticsearch-docs: https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/
:spring-data-jpa: https://projects.spring.io/spring-data-jpa/
:spring-data-jpa-api: https://docs.spring.io/spring-data/jpa/docs/current/api/org/springframework/data/jpa
:spring-data-mongodb: https://projects.spring.io/spring-data-mongodb/
:spring-data-mongodb-api: https://docs.spring.io/spring-data/mongodb/docs/current/api/org/springframework/data/mongodb
:spring-data-rest-api: https://docs.spring.io/spring-data/rest/docs/current/api/org/springframework/data/rest
:spring-framework: https://projects.spring.io/spring-framework/
:spring-framework-api: https://docs.spring.io/spring/docs/{spring-framework-version}/javadoc-api/org/springframework
:spring-framework-docs: https://docs.spring.io/spring/docs/{spring-framework-version}/spring-framework-reference/
:spring-initializr-docs: https://docs.spring.io/initializr/docs/current/reference/html
:spring-integration: https://projects.spring.io/spring-integration/
:spring-integration-docs: https://docs.spring.io/spring-integration/docs/{spring-integration-version}/reference/html
:spring-restdocs: https://projects.spring.io/spring-restdocs/
:spring-security: https://projects.spring.io/spring-security/
:spring-data-jpa: https://projects.spring.io/spring-data-jpa/
:spring-security-reference: https://docs.spring.io/spring-security/site/docs/{spring-security-docs-version}/reference/htmlsingle
:spring-security-oauth2-reference: https://projects.spring.io/spring-security-oauth/docs/oauth2.html
:spring-webservices-reference: https://docs.spring.io/spring-ws/docs/{spring-webservices-docs-version}/reference/
:spring-javadoc: https://docs.spring.io/spring/docs/{spring-docs-version}/javadoc-api/org/springframework
:spring-amqp-javadoc: https://docs.spring.io/spring-amqp/docs/current/api/org/springframework/amqp
:spring-batch-javadoc: https://docs.spring.io/spring-batch/apidocs/org/springframework/batch
:spring-data-javadoc: https://docs.spring.io/spring-data/jpa/docs/current/api/org/springframework/data/jpa
:spring-data-commons-javadoc: https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data
:spring-data-mongo-javadoc: https://docs.spring.io/spring-data/mongodb/docs/current/api/org/springframework/data/mongodb
:spring-data-mongo: https://projects.spring.io/spring-data-mongodb/
:spring-data: https://projects.spring.io/spring-data/
:spring-data-rest-javadoc: https://docs.spring.io/spring-data/rest/docs/current/api/org/springframework/data/rest
:gradle-userguide: https://www.gradle.org/docs/current/userguide
:ant-manual: https://ant.apache.org/manual
:gradle-user-guide: https://docs.gradle.org/4.2.1/userguide
:hibernate-documentation: https://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html
:jetty-documentation: https://www.eclipse.org/jetty/documentation/9.4.x
:micrometer-concepts-documentation: https://micrometer.io/docs/concepts
:micrometer-registry-documentation: https://micrometer.io/docs/registry
:tomcat-documentation: https://tomcat.apache.org/tomcat-8.5-doc
:kotlin-documentation: https://kotlinlang.org/docs/reference/
:junit5-documentation: https://junit.org/junit5/docs/current/user-guide
:spring-security-docs: https://docs.spring.io/spring-security/site/docs/{spring-security-version}/reference/htmlsingle
:spring-security-oauth2-docs: https://projects.spring.io/spring-security-oauth/docs/oauth2.html
:spring-session: https://projects.spring.io/spring-session/
:spring-webservices-docs: https://docs.spring.io/spring-ws/docs/{spring-webservices-version}/reference/
:ant-docs: https://ant.apache.org/manual
:dependency-management-plugin-code: https://github.com/spring-gradle-plugins/dependency-management-plugin
:gradle-docs: https://docs.gradle.org/4.2.1/userguide
:hibernate-docs: https://docs.jboss.org/hibernate/orm/5.3/userguide/html_single/Hibernate_User_Guide.html
:java-api: https://docs.oracle.com/javase/8/docs/api/
:jetty-docs: https://www.eclipse.org/jetty/documentation/9.4.x
:jooq-docs: https://www.jooq.org/doc/{jooq-version}/manual-single-page
:junit5-docs: https://junit.org/junit5/docs/current/user-guide
:kotlin-docs: https://kotlinlang.org/docs/reference/
:micrometer-docs: https://micrometer.io/docs
:micrometer-concepts-docs: {micrometer-docs}/concepts
:micrometer-registry-docs: {micrometer-docs}/registry
:tomcat-docs: https://tomcat.apache.org/tomcat-9.0-doc

@ -14,7 +14,7 @@ If you are just getting started, you might want to read "`<<using-spring-boot.ad
The Spring Boot Maven Plugin provides Spring Boot support in Maven, letting you package executable jar or war archives and run an application "`in-place`".
To use it, you must use Maven 3.2 (or later).
NOTE: See the {spring-boot-maven-plugin-site}[Spring Boot Maven Plugin Site] for complete plugin documentation.
NOTE: See the {spring-boot-maven-plugin-docs}[Spring Boot Maven Plugin Site] for complete plugin documentation.
@ -153,7 +153,7 @@ To build a war file that is both executable and deployable into an external cont
TIP: See the "`<<howto-create-a-deployable-war-file>>`" section for more details on how to create a deployable war file.
Advanced configuration options and examples are available in the {spring-boot-maven-plugin-site}[plugin info page].
Advanced configuration options and examples are available in the {spring-boot-maven-plugin-docs}[plugin info page].
@ -163,8 +163,8 @@ The Spring Boot Gradle Plugin provides Spring Boot support in Gradle, letting yo
It requires Gradle 5.x (4.10 is also supported but this support is deprecated and will be removed in a future release).
Please refer to the plugin's documentation to learn more:
* Reference ({spring-boot-gradle-plugin}/reference/html[HTML] and {spring-boot-gradle-plugin}/reference/pdf/spring-boot-gradle-plugin-reference.pdf[PDF])
* {spring-boot-gradle-plugin}/api[API]
* Reference ({spring-boot-gradle-plugin-docs}[HTML] and {spring-boot-gradle-plugin-pdfdocs}[PDF])
* {spring-boot-gradle-plugin-api}[API]
@ -232,10 +232,10 @@ The following nested elements can be used with the task:
| Element | Description
| `resources`
| One or more {ant-manual}/Types/resources.html#collection[Resource Collections] describing a set of {ant-manual}/Types/resources.html[Resources] that should be added to the content of the created +jar+ file.
| One or more {ant-docs}/Types/resources.html#collection[Resource Collections] describing a set of {ant-docs}/Types/resources.html[Resources] that should be added to the content of the created +jar+ file.
| `lib`
| One or more {ant-manual}/Types/resources.html#collection[Resource Collections] that should be added to the set of jar libraries that make up the runtime dependency classpath of the application.
| One or more {ant-docs}/Types/resources.html#collection[Resource Collections] that should be added to the set of jar libraries that make up the runtime dependency classpath of the application.
|====
@ -376,7 +376,7 @@ The following example shows a typical repackage implementation:
[[build-tool-plugins-whats-next]]
== What to Read Next
If you are interested in how the build tool plugins work, you can look at the {github-code}/spring-boot-project/spring-boot-tools[`spring-boot-tools`] module on GitHub.
If you are interested in how the build tool plugins work, you can look at the {spring-boot-code}/spring-boot-project/spring-boot-tools[`spring-boot-tools`] module on GitHub.
More technical details of the executable jar format are covered in <<appendix.adoc#executable-jar,the appendix>>.
If you have specific build-related questions, you can check out the "`<<howto.adoc#howto, how-to>>`" guides.

@ -123,7 +123,7 @@ Environment variables do not always make for the easiest API, so Spring Boot aut
All Cloud Foundry properties are prefixed with `vcap`.
You can use `vcap` properties to access application information (such as the public URL of the application) and service information (such as database credentials).
See the {dc-spring-boot}/cloud/CloudFoundryVcapEnvironmentPostProcessor.html['`CloudFoundryVcapEnvironmentPostProcessor`'] Javadoc for complete details.
See the {spring-boot-module-api}/cloud/CloudFoundryVcapEnvironmentPostProcessor.html['`CloudFoundryVcapEnvironmentPostProcessor`'] Javadoc for complete details.
TIP: The https://cloud.spring.io/spring-cloud-connectors/[Spring Cloud Connectors] project is a better fit for tasks such as configuring a DataSource.
Spring Boot includes auto-configuration support and a `spring-boot-starter-cloud-connectors` starter.
@ -585,7 +585,7 @@ It often makes sense to customize elements of the start script as it is written
For example, init.d scripts can provide a "`description`".
Since you know the description up front (and it need not change), you may as well provide it when the jar is generated.
To customize written elements, use the `embeddedLaunchScriptProperties` option of the Spring Boot Maven plugin or the {spring-boot-gradle-plugin-reference}/#packaging-executable-configuring-launch-script[`properties` property of the Spring Boot Gradle plugin's `launchScript`].
To customize written elements, use the `embeddedLaunchScriptProperties` option of the Spring Boot Maven plugin or the {spring-boot-gradle-plugin-docs}/#packaging-executable-configuring-launch-script[`properties` property of the Spring Boot Gradle plugin's `launchScript`].
The following property substitutions are supported with the default script:

@ -15,7 +15,7 @@ The Spring Boot reference guide is available as:
* {spring-boot-docs}/htmlsingle[Single page HTML]
* {spring-boot-docs}/pdf/spring-boot-reference.pdf[PDF]
The latest copy is available at {spring-boot-docs-current}.
The latest copy is available at {spring-boot-current-docs}.
Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
@ -36,7 +36,7 @@ If you have trouble with Spring Boot, we would like to help.
* Report bugs with Spring Boot at https://github.com/spring-projects/spring-boot/issues.
NOTE: All of Spring Boot is open source, including the documentation.
If you find problems with the docs or if you want to improve them, please {github-code}[get involved].
If you find problems with the docs or if you want to improve them, please {spring-boot-code}[get involved].

@ -30,7 +30,7 @@ Our primary goals are:
[[getting-started-system-requirements]]
== System Requirements
Spring Boot {spring-boot-version} requires https://www.java.com[Java 8] and is compatible up to Java 12 (included).
{spring-reference}[Spring Framework {spring-framework-version}] or above is also required.
{spring-framework-docs}[Spring Framework {spring-framework-version}] or above is also required.
Explicit build support is provided for the following build tools:
@ -193,10 +193,10 @@ Spring Boot provides a useful <<build-tool-plugins.adoc#build-tool-plugins-gradl
****
The Gradle Wrapper provides a nice way of "`obtaining`" Gradle when you need to build a project.
It is a small script and library that you commit alongside your code to bootstrap the build process.
See {gradle-user-guide}/gradle_wrapper.html for details.
See {gradle-docs}/gradle_wrapper.html for details.
****
More details on getting started with Spring Boot and Gradle can be found in the {spring-boot-gradle-plugin-reference}/#getting-started[Getting Started section] of the Gradle plugin's reference guide.
More details on getting started with Spring Boot and Gradle can be found in the {spring-boot-gradle-plugin-docs}/#getting-started[Getting Started section] of the Gradle plugin's reference guide.
@ -411,7 +411,7 @@ If you need to solve a specific problem, check there first.
You can shortcut the steps below by going to https://start.spring.io and choosing the "Web" starter from the dependencies searcher.
Doing so generates a new project structure so that you can <<getting-started-first-application-code,start coding right away>>.
Check the {spring-initializr-reference}/#user-guide[Spring Initializr documentation] for more details.
Check the {spring-initializr-docs}/#user-guide[Spring Initializr documentation] for more details.
====
Before we begin, open a terminal and run the following commands to ensure that you have valid versions of Java and Maven installed:
@ -577,7 +577,7 @@ It tells Spring that any HTTP request with the `/` path should be mapped to the
The `@RestController` annotation tells Spring to render the resulting string directly back to the caller.
TIP: The `@RestController` and `@RequestMapping` annotations are Spring MVC annotations (they are not specific to Spring Boot).
See the {spring-reference}web.html#mvc[MVC section] in the Spring Reference Documentation for more details.
See the {spring-framework-docs}web.html#mvc[MVC section] in the Spring Reference Documentation for more details.
@ -677,7 +677,7 @@ To do so, insert the following lines just below the `dependencies` section:
NOTE: The `spring-boot-starter-parent` POM includes `<executions>` configuration to bind the `repackage` goal.
If you do not use the parent POM, you need to declare this configuration yourself.
See the {spring-boot-maven-plugin-site}/usage.html[plugin documentation] for details.
See the {spring-boot-maven-plugin-docs}/usage.html[plugin documentation] for details.
Save your `pom.xml` and run `mvn package` from the command line, as follows:

@ -9,7 +9,7 @@ If you have a specific problem that we do not cover here, you might want to chec
This is also a great place to ask new questions (please use the `spring-boot` tag).
We are also more than happy to extend this section.
If you want to add a '`how-to`', send us a {github-code}[pull request].
If you want to add a '`how-to`', send us a {spring-boot-code}[pull request].
@ -21,7 +21,7 @@ This section includes topics relating directly to Spring Boot applications.
[[howto-failure-analyzer]]
=== Create Your Own FailureAnalyzer
{dc-spring-boot}/diagnostics/FailureAnalyzer.{dc-ext}[`FailureAnalyzer`] is a great way to intercept an exception on startup and turn it into a human-readable message, wrapped in a {dc-spring-boot}/diagnostics/FailureAnalysis.{dc-ext}[`FailureAnalysis`].
{spring-boot-module-api}/diagnostics/FailureAnalyzer.html[`FailureAnalyzer`] is a great way to intercept an exception on startup and turn it into a human-readable message, wrapped in a {spring-boot-module-api}/diagnostics/FailureAnalysis.html[`FailureAnalysis`].
Spring Boot provides such an analyzer for application-context-related exceptions, JSR-303 validations, and more.
You can also create your own.
@ -58,7 +58,7 @@ When reading the code, remember the following rules of thumb:
Pay special attention to the `+@Conditional*+` annotations to find out what features they enable and when.
Add `--debug` to the command line or a System property `-Ddebug` to get a log on the console of all the auto-configuration decisions that were made in your app.
In a running application with actuator enabled, look at the `conditions` endpoint (`/actuator/conditions` or the JMX equivalent) for the same information.
* Look for classes that are `@ConfigurationProperties` (such as {sc-spring-boot-autoconfigure}/web/ServerProperties.{sc-ext}[`ServerProperties`]) and read from there the available external configuration options.
* Look for classes that are `@ConfigurationProperties` (such as {spring-boot-autoconfigure-module-code}/web/ServerProperties.java[`ServerProperties`]) and read from there the available external configuration options.
The `@ConfigurationProperties` annotation has a `name` attribute that acts as a prefix to external properties.
Thus, `ServerProperties` has `prefix="server"` and its configuration properties are `server.port`, `server.address`, and others.
In a running application with actuator enabled, look at the `configprops` endpoint.
@ -155,7 +155,7 @@ NOTE: Only production configuration is filtered that way (in other words, no fil
TIP: If you enable the `addResources` flag, the `spring-boot:run` goal can add `src/main/resources` directly to the classpath (for hot reloading purposes).
Doing so circumvents the resource filtering and this feature.
Instead, you can use the `exec:java` goal or customize the plugin's configuration.
See the {spring-boot-maven-plugin-site}/usage.html[plugin usage page] for more details.
See the {spring-boot-maven-plugin-docs}/usage.html[plugin usage page] for more details.
If you do not use the starter parent, you need to include the following element inside the `<build/>` element of your `pom.xml`:
@ -272,7 +272,7 @@ By default, if YAML is used, then files with the '`.yml`' extension are also add
Spring Boot logs the configuration files that are loaded at the `DEBUG` level and the candidates it has not found at `TRACE` level.
See {sc-spring-boot}/context/config/ConfigFileApplicationListener.{sc-ext}[`ConfigFileApplicationListener`] for more detail.
See {spring-boot-module-code}/context/config/ConfigFileApplicationListener.java[`ConfigFileApplicationListener`] for more detail.
@ -487,7 +487,7 @@ Thanks to relaxed binding of `Environment` values, you can also use `SERVER_PORT
To switch off the HTTP endpoints completely but still create a `WebApplicationContext`, use `server.port=-1` (doing so is sometimes useful for testing).
For more details, see "`<<spring-boot-features.adoc#boot-features-customizing-embedded-containers>>`" in the '`Spring Boot Features`' section, or the {sc-spring-boot-autoconfigure}/web/ServerProperties.{sc-ext}[`ServerProperties`] source code.
For more details, see "`<<spring-boot-features.adoc#boot-features-customizing-embedded-containers>>`" in the '`Spring Boot Features`' section, or the {spring-boot-autoconfigure-module-code}/web/ServerProperties.java[`ServerProperties`] source code.
@ -571,7 +571,7 @@ The following example shows setting SSL properties in `application.properties`:
server.ssl.key-password=another-secret
----
See {sc-spring-boot}/web/server/Ssl.{sc-ext}[`Ssl`] for details of all of the supported properties.
See {spring-boot-module-code}/web/server/Ssl.java[`Ssl`] for details of all of the supported properties.
Using configuration such as the preceding example means the application no longer supports a plain HTTP connector at port 8080.
Spring Boot does not support the configuration of both an HTTP connector and an HTTPS connector through `application.properties`.
@ -644,7 +644,7 @@ Generally, you should first consider using one of the many available configurati
The `server.{asterisk}` namespace is quite useful here, and it includes namespaces like `server.tomcat.{asterisk}`, `server.jetty.{asterisk}` and others, for server-specific features.
See the list of <<common-application-properties>>.
The previous sections covered already many common use cases, such as compression, SSL or HTTP/2. However, if a configuration key doesn't exist for your use case, you should then look at {dc-spring-boot}/web/server/WebServerFactoryCustomizer.html[`WebServerFactoryCustomizer`].
The previous sections covered already many common use cases, such as compression, SSL or HTTP/2. However, if a configuration key doesn't exist for your use case, you should then look at {spring-boot-module-api}/web/server/WebServerFactoryCustomizer.html[`WebServerFactoryCustomizer`].
You can declare such a component and get access to the server factory relevant to your choice: you should select the variant for the chosen Server (Tomcat, Jetty, Reactor Netty, Undertow) and the chosen web stack (Servlet or Reactive).
The example below is for Tomcat with the `spring-boot-starter-web` (Servlet stack):
@ -750,7 +750,7 @@ By default, `@ServletComponentScan` scans from the package of the annotated clas
=== Configure Access Logging
Access logs can be configured for Tomcat, Undertow, and Jetty through their respective namespaces.
For instance, the following settings log access on Tomcat with a {tomcat-documentation}/config/valve.html#Access_Logging[custom pattern].
For instance, the following settings log access on Tomcat with a {tomcat-docs}/config/valve.html#Access_Logging[custom pattern].
[source,properties,indent=0,subs="verbatim,quotes,attributes"]
----
@ -783,7 +783,7 @@ Finally, access logging for Jetty can also be configured as follows:
----
By default, logs are redirected to `System.err`.
For more details, see {jetty-documentation}/configuring-jetty-request-logs.html[the Jetty documentation].
For more details, see {jetty-docs}/configuring-jetty-request-logs.html[the Jetty documentation].
@ -1074,7 +1074,7 @@ If you provide any `@Beans` of type `MappingJackson2HttpMessageConverter`, they
Also, a convenience bean of type `HttpMessageConverters` is provided (and is always available if you use the default MVC configuration).
It has some useful methods to access the default and user-enhanced message converters.
See the "`<<howto-customize-the-responsebody-rendering>>`" section and the {sc-spring-boot-autoconfigure}/web/servlet/WebMvcAutoConfiguration.{sc-ext}[`WebMvcAutoConfiguration`] source code for more details.
See the "`<<howto-customize-the-responsebody-rendering>>`" section and the {spring-boot-autoconfigure-module-code}/web/servlet/WebMvcAutoConfiguration.java[`WebMvcAutoConfiguration`] source code for more details.
@ -1090,7 +1090,7 @@ As in normal MVC usage, any `WebMvcConfigurer` beans that you provide can also c
However, unlike with normal MVC, you can supply only additional converters that you need (because Spring Boot uses the same mechanism to contribute its defaults).
Finally, if you opt out of the Spring Boot default MVC configuration by providing your own `@EnableWebMvc` configuration, you can take control completely and do everything manually by using `getMessageConverters` from `WebMvcConfigurationSupport`.
See the {sc-spring-boot-autoconfigure}/web/servlet/WebMvcAutoConfiguration.{sc-ext}[`WebMvcAutoConfiguration`] source code for more details.
See the {spring-boot-autoconfigure-module-code}/web/servlet/WebMvcAutoConfiguration.java[`WebMvcAutoConfiguration`] source code for more details.
@ -1103,7 +1103,7 @@ For example, if you want to specify that files be unlimited, set the `spring.ser
The multipart support is helpful when you want to receive multipart encoded file data as a `@RequestParam`-annotated parameter of type `MultipartFile` in a Spring MVC controller handler method.
See the {sc-spring-boot-autoconfigure}/web/servlet/MultipartAutoConfiguration.{sc-ext}[`MultipartAutoConfiguration`] source for more details.
See the {spring-boot-autoconfigure-module-code}/web/servlet/MultipartAutoConfiguration.java[`MultipartAutoConfiguration`] source for more details.
NOTE: It is recommended to use the container's built-in support for multipart uploads rather than introducing an additional dependency such as Apache Commons File Upload.
@ -1171,10 +1171,10 @@ If you add your own, you have to be aware of the order and in which position you
For more detail, see the following sections:
* {sc-spring-boot-autoconfigure}/web/servlet/WebMvcAutoConfiguration.{sc-ext}[`WebMvcAutoConfiguration`]
* {sc-spring-boot-autoconfigure}/thymeleaf/ThymeleafAutoConfiguration.{sc-ext}[`ThymeleafAutoConfiguration`]
* {sc-spring-boot-autoconfigure}/freemarker/FreeMarkerAutoConfiguration.{sc-ext}[`FreeMarkerAutoConfiguration`]
* {sc-spring-boot-autoconfigure}/groovy/template/GroovyTemplateAutoConfiguration.{sc-ext}[`GroovyTemplateAutoConfiguration`]
* {spring-boot-autoconfigure-module-code}/web/servlet/WebMvcAutoConfiguration.java[`WebMvcAutoConfiguration`]
* {spring-boot-autoconfigure-module-code}/thymeleaf/ThymeleafAutoConfiguration.java[`ThymeleafAutoConfiguration`]
* {spring-boot-autoconfigure-module-code}/freemarker/FreeMarkerAutoConfiguration.java[`FreeMarkerAutoConfiguration`]
* {spring-boot-autoconfigure-module-code}/groovy/template/GroovyTemplateAutoConfiguration.java[`GroovyTemplateAutoConfiguration`]
@ -1514,7 +1514,7 @@ This example uses a more generic `configuration` sub namespace as the example do
NOTE: Because your custom configuration chooses to go with Hikari, `app.datasource.type` has no effect.
In practice, the builder is initialized with whatever value you might set there and then overridden by the call to `.type()`.
See "`<<spring-boot-features.adoc#boot-features-configure-datasource>>`" in the "`Spring Boot features`" section and the {sc-spring-boot-autoconfigure}/jdbc/DataSourceAutoConfiguration.{sc-ext}[`DataSourceAutoConfiguration`] class for more details.
See "`<<spring-boot-features.adoc#boot-features-configure-datasource>>`" in the "`Spring Boot features`" section and the {spring-boot-autoconfigure-module-code}/jdbc/DataSourceAutoConfiguration.java[`DataSourceAutoConfiguration`] class for more details.
@ -1623,7 +1623,7 @@ This takes precedence to anything that is applied by the auto-configuration.
[[howto-configure-hibernate-naming-strategy]]
=== Configure Hibernate Naming Strategy
Hibernate uses {hibernate-documentation}#naming[two different naming strategies] to map names from the object model to the corresponding database names.
Hibernate uses {hibernate-docs}#naming[two different naming strategies] to map names from the object model to the corresponding database names.
The fully qualified class name of the physical and the implicit strategy implementations can be configured by setting the `spring.jpa.hibernate.naming.physical-strategy` and `spring.jpa.hibernate.naming.implicit-strategy` properties, respectively.
Alternatively, if `ImplicitNamingStrategy` or `PhysicalNamingStrategy` beans are available in the application context, Hibernate will be automatically configured to use them.
@ -1650,13 +1650,13 @@ Alternatively, you can configure the following bean:
}
----
See {sc-spring-boot-autoconfigure}/orm/jpa/HibernateJpaAutoConfiguration.{sc-ext}[`HibernateJpaAutoConfiguration`] and {sc-spring-boot-autoconfigure}/orm/jpa/JpaBaseConfiguration.{sc-ext}[`JpaBaseConfiguration`] for more details.
See {spring-boot-autoconfigure-module-code}/orm/jpa/HibernateJpaAutoConfiguration.java[`HibernateJpaAutoConfiguration`] and {spring-boot-autoconfigure-module-code}/orm/jpa/JpaBaseConfiguration.java[`JpaBaseConfiguration`] for more details.
[[howto-configure-hibernate-second-level-caching]]
=== Configure Hibernate Second-Level Caching
Hibernate {hibernate-documentation}#caching[second-level cache] can be configured for a range of cache providers.
Hibernate {hibernate-docs}#caching[second-level cache] can be configured for a range of cache providers.
Rather than configuring Hibernate to lookup the cache provider again, it is better to provide the one that is available in the context whenever possible.
If you're using JCache, this is pretty easy. First, make sure that `org.hibernate:hibernate-jcache` is available on the classpath.
@ -1669,7 +1669,7 @@ include::{code-examples}/jpa/HibernateSecondLevelCacheExample.java[tag=configura
This customizer will configure Hibernate to use the same `CacheManager` as the one that the application uses.
It is also possible to use separate `CacheManager` instances.
For details, refer to {hibernate-documentation}#caching-provider-jcache[the Hibernate user guide].
For details, refer to {hibernate-docs}#caching-provider-jcache[the Hibernate user guide].
@ -1752,7 +1752,7 @@ If you use Spring Data, you need to configure `@EnableJpaRepositories` according
Spring Boot will not search for or use a `META-INF/persistence.xml` by default.
If you prefer to use a traditional `persistence.xml`, you need to define your own `@Bean` of type `LocalEntityManagerFactoryBean` (with an ID of '`entityManagerFactory`') and set the persistence unit name there.
See {sc-spring-boot-autoconfigure}/orm/jpa/JpaBaseConfiguration.{sc-ext}[`JpaBaseConfiguration`] for the default settings.
See {spring-boot-autoconfigure-module-code}/orm/jpa/JpaBaseConfiguration.java[`JpaBaseConfiguration`] for the default settings.
@ -1782,8 +1782,8 @@ Note that if you are using Spring Data REST, you must use the properties in the
Spring Data REST can expose the `Repository` implementations as REST endpoints for you,
provided Spring MVC has been enabled for the application.
Spring Boot exposes a set of useful properties (from the `spring.data.rest` namespace) that customize the {spring-data-rest-javadoc}/core/config/RepositoryRestConfiguration.{dc-ext}[`RepositoryRestConfiguration`].
If you need to provide additional customization, you should use a {spring-data-rest-javadoc}/webmvc/config/RepositoryRestConfigurer.{dc-ext}[`RepositoryRestConfigurer`] bean.
Spring Boot exposes a set of useful properties (from the `spring.data.rest` namespace) that customize the {spring-data-rest-api}/core/config/RepositoryRestConfiguration.html[`RepositoryRestConfiguration`].
If you need to provide additional customization, you should use a {spring-data-rest-api}/webmvc/config/RepositoryRestConfigurer.html[`RepositoryRestConfigurer`] bean.
NOTE: If you do not specify any order on your custom `RepositoryRestConfigurer`, it runs after the one Spring Boot uses internally.
If you need to specify an order, make sure it is higher than 0.
@ -1809,7 +1809,7 @@ include::{code-examples}/elasticsearch/HibernateSearchElasticsearchExample.java[
[[howto-configure-jOOQ-with-multiple-datasources]]
=== Configure jOOQ with Two DataSources
If you need to use jOOQ with multiple data sources, you should create your own `DSLContext` for each one.
Refer to {sc-spring-boot-autoconfigure}/jooq/JooqAutoConfiguration.{sc-ext}[JooqAutoConfiguration] for more details.
Refer to {spring-boot-autoconfigure-module-code}/jooq/JooqAutoConfiguration.java[JooqAutoConfiguration] for more details.
TIP: In particular, `JooqExceptionTranslator` and `SpringTransactionProvider` can be reused to provide similar features to what the auto-configuration does with a single `DataSource`.
@ -1926,15 +1926,15 @@ Assume the following:
----
Rather than using `db/migration`, the preceding configuration sets the folder to use according to the type of the database (such as `db/migration/mysql` for MySQL).
The list of supported databases is available in {sc-spring-boot}/jdbc/DatabaseDriver.{sc-ext}[`DatabaseDriver`].
The list of supported databases is available in {spring-boot-module-code}/jdbc/DatabaseDriver.java[`DatabaseDriver`].
Migrations can also be written in Java. Flyway will be auto-configured with any beans that implement `JavaMigration`.
{sc-spring-boot-autoconfigure}/flyway/FlywayProperties.{sc-ext}[`FlywayProperties`] provides most of Flyway's settings and a small set of additional properties that can be used to disable the migrations or switch off the location checking.
{spring-boot-autoconfigure-module-code}/flyway/FlywayProperties.java[`FlywayProperties`] provides most of Flyway's settings and a small set of additional properties that can be used to disable the migrations or switch off the location checking.
If you need more control over the configuration, consider registering a `FlywayConfigurationCustomizer` bean.
Spring Boot calls `Flyway.migrate()` to perform the database migration.
If you would like more control, provide a `@Bean` that implements {sc-spring-boot-autoconfigure}/flyway/FlywayMigrationStrategy.{sc-ext}[`FlywayMigrationStrategy`].
If you would like more control, provide a `@Bean` that implements {spring-boot-autoconfigure-module-code}/flyway/FlywayMigrationStrategy.java[`FlywayMigrationStrategy`].
Flyway supports SQL and Java https://flywaydb.org/documentation/callbacks.html[callbacks].
To use SQL-based callbacks, place the callback scripts in the `classpath:db/migration` folder.
@ -1978,7 +1978,7 @@ Alternatively, you can use Liquibase's native `DataSource` by setting `spring.li
Setting either `spring.liquibase.url` or `spring.liquibase.user` is sufficient to cause Liquibase to use its own `DataSource`.
If any of the three properties has not be set, the value of its equivalent `spring.datasource` property will be used.
See {sc-spring-boot-autoconfigure}/liquibase/LiquibaseProperties.{sc-ext}[`LiquibaseProperties`] for details about available settings such as contexts, the default schema, and others.
See {spring-boot-autoconfigure-module-code}/liquibase/LiquibaseProperties.java[`LiquibaseProperties`] for details about available settings such as contexts, the default schema, and others.
@ -2023,7 +2023,7 @@ Batch autowires a single `DataSource` in your context and uses that for processi
To have Batch use a `DataSource` other than the applications main `DataSource`, declare a `DataSource` bean, annotating its `@Bean` method with `@BatchDataSource`.
If you do so and want two data sources, remember to create another one and mark it as `@Primary`.
To take greater control, implement `BatchConfigurer`.
See {spring-batch-javadoc}/core/configuration/annotation/EnableBatchProcessing.html[the Javadoc of `@EnableBatchProcessing`] for more details.
See {spring-batch-api}/core/configuration/annotation/EnableBatchProcessing.html[The Javadoc of `@EnableBatchProcessing`] for more details.
For more about Spring Batch, see the https://projects.spring.io/spring-batch/[Spring Batch project page].
@ -2033,7 +2033,7 @@ For more about Spring Batch, see the https://projects.spring.io/spring-batch/[Sp
=== Execute Spring Batch Jobs on Startup
Spring Batch auto-configuration is enabled by adding `@EnableBatchProcessing` (from Spring Batch) somewhere in your context.
By default, it executes *all* `Jobs` in the application context on startup (see {sc-spring-boot-autoconfigure}/batch/JobLauncherCommandLineRunner.{sc-ext}[JobLauncherCommandLineRunner] for details).
By default, it executes *all* `Jobs` in the application context on startup (see {spring-boot-autoconfigure-module-code}/batch/JobLauncherCommandLineRunner.java[JobLauncherCommandLineRunner] for details).
You can narrow down to a specific job or jobs by specifying `spring.batch.job.names` (which takes a comma-separated list of job name patterns).
[TIP]
@ -2045,7 +2045,7 @@ Unlike command line option arguments that <<spring-boot-features.adoc#boot-featu
If the application context includes a `JobRegistry`, the jobs in `spring.batch.job.names` are looked up in the registry instead of being autowired from the context.
This is a common pattern with more complex systems, where multiple jobs are defined in child contexts and registered centrally.
See {sc-spring-boot-autoconfigure}/batch/BatchAutoConfiguration.{sc-ext}[BatchAutoConfiguration] and https://github.com/spring-projects/spring-batch/blob/master/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java[@EnableBatchProcessing] for more details.
See {spring-boot-autoconfigure-module-code}/batch/BatchAutoConfiguration.java[BatchAutoConfiguration] and https://github.com/spring-projects/spring-batch/blob/master/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java[@EnableBatchProcessing] for more details.
@ -2061,7 +2061,7 @@ In a standalone application, the Actuator HTTP port defaults to the same as the
To make the application listen on a different port, set the external property: `management.server.port`.
To listen on a completely different network address (such as when you have an internal network for management and an external one for user applications), you can also set `management.server.address` to a valid IP address to which the server is able to bind.
For more detail, see the {sc-spring-boot-actuator-autoconfigure}/web/server/ManagementServerProperties.{sc-ext}[`ManagementServerProperties`] source code and "`<<production-ready-features.adoc#production-ready-customizing-management-server-port>>`" in the "`Production-ready features`" section.
For more detail, see the {spring-boot-actuator-autoconfigure-module-code}/web/server/ManagementServerProperties.java[`ManagementServerProperties`] source code and "`<<production-ready-features.adoc#production-ready-customizing-management-server-port>>`" in the "`Production-ready features`" section.
@ -2078,7 +2078,7 @@ For example, if you use Thymeleaf, you can add an `error.html` template.
If you use FreeMarker, you can add an `error.ftlh` template.
In general, you need a `View` that resolves with a name of `error` or a `@Controller` that handles the `/error` path.
Unless you replaced some of the default configuration, you should find a `BeanNameViewResolver` in your `ApplicationContext`, so a `@Bean` named `error` would be a simple way of doing that.
See {sc-spring-boot-autoconfigure}/web/servlet/error/ErrorMvcAutoConfiguration.{sc-ext}[`ErrorMvcAutoConfiguration`] for more options.
See {spring-boot-autoconfigure-module-code}/web/servlet/error/ErrorMvcAutoConfiguration.java[`ErrorMvcAutoConfiguration`] for more options.
See also the section on "`<<boot-features-error-handling, Error Handling>>`" for details of how to register handlers in the servlet container.
@ -2184,21 +2184,21 @@ If you use the `spring-boot-devtools` module, these properties are <<using-sprin
[[howto-reload-thymeleaf-content]]
==== Thymeleaf Templates
If you use Thymeleaf, set `spring.thymeleaf.cache` to `false`.
See {sc-spring-boot-autoconfigure}/thymeleaf/ThymeleafAutoConfiguration.{sc-ext}[`ThymeleafAutoConfiguration`] for other Thymeleaf customization options.
See {spring-boot-autoconfigure-module-code}/thymeleaf/ThymeleafAutoConfiguration.java[`ThymeleafAutoConfiguration`] for other Thymeleaf customization options.
[[howto-reload-freemarker-content]]
==== FreeMarker Templates
If you use FreeMarker, set `spring.freemarker.cache` to `false`.
See {sc-spring-boot-autoconfigure}/freemarker/FreeMarkerAutoConfiguration.{sc-ext}[`FreeMarkerAutoConfiguration`] for other FreeMarker customization options.
See {spring-boot-autoconfigure-module-code}/freemarker/FreeMarkerAutoConfiguration.java[`FreeMarkerAutoConfiguration`] for other FreeMarker customization options.
[[howto-reload-groovy-template-content]]
==== Groovy Templates
If you use Groovy templates, set `spring.groovy.template.cache` to `false`.
See {sc-spring-boot-autoconfigure}/groovy/template/GroovyTemplateAutoConfiguration.{sc-ext}[`GroovyTemplateAutoConfiguration`] for other Groovy customization options.
See {spring-boot-autoconfigure-module-code}/groovy/template/GroovyTemplateAutoConfiguration.java[`GroovyTemplateAutoConfiguration`] for other Groovy customization options.
@ -2254,7 +2254,7 @@ To generate build information with Maven, add an execution for the `build-info`
</build>
----
TIP: See the {spring-boot-maven-plugin-site}[Spring Boot Maven Plugin documentation] for more details.
TIP: See the {spring-boot-maven-plugin-docs}[Spring Boot Maven Plugin documentation] for more details.
The following example does the same with Gradle:
@ -2265,7 +2265,7 @@ The following example does the same with Gradle:
}
----
TIP: See the {spring-boot-gradle-plugin-reference}/#integrating-with-actuator-build-info[Spring Boot Gradle Plugin documentation] for more details.
TIP: See the {spring-boot-gradle-plugin-docs}/#integrating-with-actuator-build-info[Spring Boot Gradle Plugin documentation] for more details.
@ -2306,7 +2306,7 @@ Using this format lets the time be parsed into a `Date` and its format, when ser
[[howto-customize-dependency-versions]]
=== Customize Dependency Versions
If you use a Maven build that inherits directly or indirectly from `spring-boot-dependencies` (for instance, `spring-boot-starter-parent`) but you want to override a specific third-party dependency, you can add appropriate `<properties>` elements.
Browse the {github-code}/spring-boot-project/spring-boot-dependencies/pom.xml[`spring-boot-dependencies`] POM for a complete list of properties.
Browse the {spring-boot-code}/spring-boot-project/spring-boot-dependencies/pom.xml[`spring-boot-dependencies`] POM for a complete list of properties.
For example, to pick a different `slf4j` version, you would add the following property:
[source,xml,indent=0,subs="verbatim,quotes,attributes"]
@ -2322,7 +2322,7 @@ If you have added `spring-boot-dependencies` in your own `dependencyManagement`
WARNING: Each Spring Boot release is designed and tested against this specific set of third-party dependencies.
Overriding versions may cause compatibility issues.
To override dependency versions in Gradle, see {spring-boot-gradle-plugin-reference}/#managing-dependencies-customizing[this section] of the Gradle plugin's documentation.
To override dependency versions in Gradle, see {spring-boot-gradle-plugin-docs}/#managing-dependencies-customizing[this section] of the Gradle plugin's documentation.
@ -2366,7 +2366,7 @@ However, you must additionally add an `<executions>` section, as follows:
</build>
----
See the {spring-boot-maven-plugin-site}/usage.html[plugin documentation] for full usage details.
See the {spring-boot-maven-plugin-docs}/usage.html[plugin documentation] for full usage details.
@ -2478,9 +2478,9 @@ In Maven, the executable jar must be the main artifact and you can add a classif
[[howto-remote-debug-maven-run]]
=== Remote Debug a Spring Boot Application Started with Maven
To attach a remote debugger to a Spring Boot application that was started with Maven, you can use the `jvmArguments` property of the {spring-boot-maven-plugin-site}[maven plugin].
To attach a remote debugger to a Spring Boot application that was started with Maven, you can use the `jvmArguments` property of the {spring-boot-maven-plugin-docs}[maven plugin].
See {spring-boot-maven-plugin-site}/examples/run-debug.html[this example] for more details.
See {spring-boot-maven-plugin-docs}/examples/run-debug.html[this example] for more details.

@ -10,7 +10,7 @@ Auditing, health, and metrics gathering can also be automatically applied to you
[[production-ready-enabling]]
== Enabling Production-ready Features
The {github-code}/spring-boot-project/spring-boot-actuator[`spring-boot-actuator`] module provides all of Spring Boot's production-ready features.
The {spring-boot-code}/spring-boot-project/spring-boot-actuator[`spring-boot-actuator`] module provides all of Spring Boot's production-ready features.
The simplest way to enable the features is to add a dependency to the `spring-boot-starter-actuator` '`Starter`'.
.Definition of Actuator
@ -162,7 +162,7 @@ If your application is a web application (Spring MVC, Spring WebFlux, or Jersey)
| Yes
|===
To learn more about the Actuator's endpoints and their request and response formats, please refer to the separate API documentation ({spring-boot-actuator-api}/html[HTML] or {spring-boot-actuator-api}/pdf/spring-boot-actuator-web-api.pdf[PDF]).
To learn more about the Actuator's endpoints and their request and response formats, please refer to the separate API documentation ({spring-boot-actuator-restapi}/html[HTML] or {spring-boot-actuator-restapi}/pdf/spring-boot-actuator-web-api.pdf[PDF]).
@ -377,7 +377,7 @@ A typical Spring Security configuration might look something like the following
The preceding example uses `EndpointRequest.toAnyEndpoint()` to match a request to any endpoint and then ensures that all have the `ENDPOINT_ADMIN` role.
Several other matcher methods are also available on `EndpointRequest`.
See the API documentation ({spring-boot-actuator-api}/html[HTML] or {spring-boot-actuator-api}/pdf/spring-boot-actuator-web-api.pdf[PDF]) for details.
See the API documentation ({spring-boot-actuator-restapi}/html[HTML] or {spring-boot-actuator-restapi}/pdf/spring-boot-actuator-web-api.pdf[PDF]) for details.
If you deploy applications behind a firewall, you may prefer that all your actuator endpoints can be accessed without requiring authentication.
You can do so by changing the `management.endpoints.web.exposure.include` property, as follows:
@ -448,7 +448,7 @@ The following configuration permits `GET` and `POST` calls from the `example.com
management.endpoints.web.cors.allowed-methods=GET,POST
----
TIP: See {sc-spring-boot-actuator-autoconfigure}/endpoint/web/CorsEndpointProperties.{sc-ext}[CorsEndpointProperties] for a complete list of options.
TIP: See {spring-boot-actuator-autoconfigure-module-code}/endpoint/web/CorsEndpointProperties.java[CorsEndpointProperties] for a complete list of options.
@ -644,7 +644,7 @@ The roles can be configured using the `management.endpoint.health.roles` propert
NOTE: If you have secured your application and wish to use `always`, your security configuration must permit access to the health endpoint for both authenticated and unauthenticated users.
Health information is collected from the content of a {sc-spring-boot-actuator}/health/HealthContributorRegistry.{sc-ext}[`HealthContributorRegistry`] (by default all {sc-spring-boot-actuator}/health/HealthContributor.{sc-ext}[`HealthContributor`] instances defined in your `ApplicationContext`).
Health information is collected from the content of a {spring-boot-actuator-module-code}/health/HealthContributorRegistry.java[`HealthContributorRegistry`] (by default all {spring-boot-actuator-module-code}/health/HealthContributor.java[`HealthContributor`] instances defined in your `ApplicationContext`).
Spring Boot includes a number of auto-configured `HealthContributors` and you can also write your own.
A `HealthContributor` can either be a `HealthIndicator` or a `CompositeHealthContributor`.
@ -667,49 +667,49 @@ The following `HealthIndicators` are auto-configured by Spring Boot when appropr
|===
| Name | Description
| {sc-spring-boot-actuator}/cassandra/CassandraHealthIndicator.{sc-ext}[`CassandraHealthIndicator`]
| {spring-boot-actuator-module-code}/cassandra/CassandraHealthIndicator.java[`CassandraHealthIndicator`]
| Checks that a Cassandra database is up.
| {sc-spring-boot-actuator}/couchbase/CouchbaseHealthIndicator.{sc-ext}[`CouchbaseHealthIndicator`]
| {spring-boot-actuator-module-code}/couchbase/CouchbaseHealthIndicator.java[`CouchbaseHealthIndicator`]
| Checks that a Couchbase cluster is up.
| {sc-spring-boot-actuator}/system/DiskSpaceHealthIndicator.{sc-ext}[`DiskSpaceHealthIndicator`]
| {spring-boot-actuator-module-code}/system/DiskSpaceHealthIndicator.java[`DiskSpaceHealthIndicator`]
| Checks for low disk space.
| {sc-spring-boot-actuator}/elasticsearch/ElasticSearchRestHealthContributorAutoConfiguration.{sc-ext}[`ElasticSearchRestHealthContributorAutoConfiguration`]
| {spring-boot-actuator-module-code}/elasticsearch/ElasticSearchRestHealthContributorAutoConfiguration.java[`ElasticSearchRestHealthContributorAutoConfiguration`]
| Checks that an Elasticsearch cluster is up.
| {sc-spring-boot-actuator}/hazelcast/HazelcastHealthIndicator.{sc-ext}[`HazelcastHealthIndicator`]
| {spring-boot-actuator-module-code}/hazelcast/HazelcastHealthIndicator.java[`HazelcastHealthIndicator`]
| Checks that an Hazelcast server is up.
| {sc-spring-boot-actuator}/influx/InfluxDbHealthIndicator.{sc-ext}[`InfluxDbHealthIndicator`]
| {spring-boot-actuator-module-code}/influx/InfluxDbHealthIndicator.java[`InfluxDbHealthIndicator`]
| Checks that an InfluxDB server is up.
| {sc-spring-boot-actuator}/influx/InfluxDbHealthIndicator.{sc-ext}[`InfluxDbHealthIndicator`]
| {spring-boot-actuator-module-code}/influx/InfluxDbHealthIndicator.java[`InfluxDbHealthIndicator`]
| Checks that an InfluxDB server is up.
| {sc-spring-boot-actuator}/jms/JmsHealthIndicator.{sc-ext}[`JmsHealthIndicator`]
| {spring-boot-actuator-module-code}/jms/JmsHealthIndicator.java[`JmsHealthIndicator`]
| Checks that a JMS broker is up.
| {sc-spring-boot-actuator}/mail/MailHealthIndicator.{sc-ext}[`MailHealthIndicator`]
| {spring-boot-actuator-module-code}/mail/MailHealthIndicator.java[`MailHealthIndicator`]
| Checks that a mail server is up.
| {sc-spring-boot-actuator}/mongo/MongoHealthIndicator.{sc-ext}[`MongoHealthIndicator`]
| {spring-boot-actuator-module-code}/mongo/MongoHealthIndicator.java[`MongoHealthIndicator`]
| Checks that a Mongo database is up.
| {sc-spring-boot-actuator}/health/PingHealthIndicator.{sc-ext}[`PingHealthIndicator`]
| {spring-boot-actuator-module-code}/health/PingHealthIndicator.java[`PingHealthIndicator`]
| Always responds with `UP`.
| {sc-spring-boot-actuator}/amqp/RabbitHealthIndicator.{sc-ext}[`RabbitHealthIndicator`]
| {spring-boot-actuator-module-code}/amqp/RabbitHealthIndicator.java[`RabbitHealthIndicator`]
| Checks that a Rabbit server is up.
| {sc-spring-boot-actuator}/amqp/RabbitHealthIndicator.{sc-ext}[`RabbitHealthIndicator`]
| {spring-boot-actuator-module-code}/amqp/RabbitHealthIndicator.java[`RabbitHealthIndicator`]
| Checks that a Rabbit server is up.
| {sc-spring-boot-actuator}/redis/RedisHealthIndicator.{sc-ext}[`RedisHealthIndicator`]
| {spring-boot-actuator-module-code}/redis/RedisHealthIndicator.java[`RedisHealthIndicator`]
| Checks that a Redis server is up.
| {sc-spring-boot-actuator}/solr/SolrHealthIndicator.{sc-ext}[`SolrHealthIndicator`]
| {spring-boot-actuator-module-code}/solr/SolrHealthIndicator.java[`SolrHealthIndicator`]
| Checks that a Solr server is up.
|===
@ -718,7 +718,7 @@ TIP: You can disable them all by setting the `management.health.defaults.enabled
==== Writing Custom HealthIndicators
To provide custom health information, you can register Spring beans that implement the {sc-spring-boot-actuator}/health/HealthIndicator.{sc-ext}[`HealthIndicator`] interface.
To provide custom health information, you can register Spring beans that implement the {spring-boot-actuator-module-code}/health/HealthIndicator.java[`HealthIndicator`] interface.
You need to provide an implementation of the `health()` method and return a `Health` response.
The `Health` response should include a status and can optionally include additional details to be displayed.
The following code shows a sample `HealthIndicator` implementation:
@ -747,8 +747,8 @@ The following code shows a sample `HealthIndicator` implementation:
NOTE: The identifier for a given `HealthIndicator` is the name of the bean without the `HealthIndicator` suffix, if it exists.
In the preceding example, the health information is available in an entry named `my`.
In addition to Spring Boot's predefined {sc-spring-boot-actuator}/health/Status.{sc-ext}[`Status`] types, it is also possible for `Health` to return a custom `Status` that represents a new system state.
In such cases, a custom implementation of the {sc-spring-boot-actuator}/health/StatusAggregator.{sc-ext}[`StatusAggregator`] interface also needs to be provided, or the default implementation has to be configured by using the `management.endpoint.health.status.order` configuration property.
In addition to Spring Boot's predefined {spring-boot-actuator-module-code}/health/Status.java[`Status`] types, it is also possible for `Health` to return a custom `Status` that represents a new system state.
In such cases, a custom implementation of the{spring-boot-actuator-module-code}/health/StatusAggregator.java[`StatusAggregator`] interface also needs to be provided, or the default implementation has to be configured by using the `management.endpoint.health.status.order` configuration property.
For example, assume a new `Status` with code `FATAL` is being used in one of your `HealthIndicator` implementations.
To configure the severity order, add the following property to your application properties:
@ -792,12 +792,12 @@ The following table shows the default status mappings for the built-in statuses:
[[reactive-health-indicators]]
==== Reactive Health Indicators
For reactive applications, such as those using Spring WebFlux, `ReactiveHealthContributor` provides a non-blocking contract for getting application health.
Similar to a traditional `HealthContributor`, health information is collected from the content of a {sc-spring-boot-actuator}/health/ReactiveHealthContributorRegistry.{sc-ext}[`ReactiveHealthContributorRegistry`] (by default all {sc-spring-boot-actuator}/health/HealthContributor.{sc-ext}[`HealthContributor`] and {sc-spring-boot-actuator}/health/ReactiveHealthContributor.{sc-ext}[`ReactiveHealthContributor`] instances defined in your `ApplicationContext`).
Similar to a traditional `HealthContributor`, health information is collected from the content of a {spring-boot-actuator-module-code}/health/ReactiveHealthContributorRegistry.java[`ReactiveHealthContributorRegistry`] (by default all {spring-boot-actuator-module-code}/health/HealthContributor.java[`HealthContributor`] and {spring-boot-actuator-module-code}/health/ReactiveHealthContributor.java[`ReactiveHealthContributor`] instances defined in your `ApplicationContext`).
Regular `HealthContributors` that do not check against a reactive API are executed on the elastic scheduler.
TIP: In a reactive application, The `ReactiveHealthContributorRegistry` can be used to register and unregister health indicators at runtime.
To provide custom health information from a reactive API, you can register Spring beans that implement the {sc-spring-boot-actuator}/health/ReactiveHealthIndicator.{sc-ext}[`ReactiveHealthIndicator`] interface.
To provide custom health information from a reactive API, you can register Spring beans that implement the {spring-boot-actuator-module-code}/health/ReactiveHealthIndicator.java[`ReactiveHealthIndicator`] interface.
The following code shows a sample `ReactiveHealthIndicator` implementation:
[source,java,indent=0]
@ -825,16 +825,16 @@ The following `ReactiveHealthIndicators` are auto-configured by Spring Boot when
|===
| Name | Description
| {sc-spring-boot-actuator}/cassandra/CassandraReactiveHealthIndicator.{sc-ext}[`CassandraReactiveHealthIndicator`]
| {spring-boot-actuator-module-code}/cassandra/CassandraReactiveHealthIndicator.java[`CassandraReactiveHealthIndicator`]
| Checks that a Cassandra database is up.
| {sc-spring-boot-actuator}/couchbase/CouchbaseReactiveHealthIndicator.{sc-ext}[`CouchbaseReactiveHealthIndicator`]
| {spring-boot-actuator-module-code}/couchbase/CouchbaseReactiveHealthIndicator.java[`CouchbaseReactiveHealthIndicator`]
| Checks that a Couchbase cluster is up.
| {sc-spring-boot-actuator}/mongo/MongoReactiveHealthIndicator.{sc-ext}[`MongoReactiveHealthIndicator`]
| {spring-boot-actuator-module-code}/mongo/MongoReactiveHealthIndicator.java[`MongoReactiveHealthIndicator`]
| Checks that a Mongo database is up.
| {sc-spring-boot-actuator}/redis/RedisReactiveHealthIndicator.{sc-ext}[`RedisReactiveHealthIndicator`]
| {spring-boot-actuator-module-code}/redis/RedisReactiveHealthIndicator.java[`RedisReactiveHealthIndicator`]
| Checks that a Redis server is up.
|===
@ -875,7 +875,7 @@ TIP: You can use `@Qualifier("groupname")` if you need to register custom `Statu
[[production-ready-application-info]]
=== Application Information
Application information exposes various information collected from all {sc-spring-boot-actuator}/info/InfoContributor.{sc-ext}[`InfoContributor`] beans defined in your `ApplicationContext`.
Application information exposes various information collected from all {spring-boot-actuator-module-code}/info/InfoContributor.java[`InfoContributor`] beans defined in your `ApplicationContext`.
Spring Boot includes a number of auto-configured `InfoContributor` beans, and you can write your own.
@ -888,13 +888,13 @@ The following `InfoContributor` beans are auto-configured by Spring Boot, when a
|===
| Name | Description
| {sc-spring-boot-actuator}/info/EnvironmentInfoContributor.{sc-ext}[`EnvironmentInfoContributor`]
| {spring-boot-actuator-module-code}/info/EnvironmentInfoContributor.java[`EnvironmentInfoContributor`]
| Exposes any key from the `Environment` under the `info` key.
| {sc-spring-boot-actuator}/info/GitInfoContributor.{sc-ext}[`GitInfoContributor`]
| {spring-boot-actuator-module-code}/info/GitInfoContributor.java[`GitInfoContributor`]
| Exposes git information if a `git.properties` file is available.
| {sc-spring-boot-actuator}/info/BuildInfoContributor.{sc-ext}[`BuildInfoContributor`]
| {spring-boot-actuator-module-code}/info/BuildInfoContributor.java[`BuildInfoContributor`]
| Exposes build information if a `META-INF/build-info.properties` file is available.
|===
@ -960,7 +960,7 @@ See "<<howto.adoc#howto-build-info,Generate build information>>" for more detail
[[production-ready-application-info-custom]]
==== Writing Custom InfoContributors
To provide custom application information, you can register Spring beans that implement the {sc-spring-boot-actuator}/info/InfoContributor.{sc-ext}[`InfoContributor`] interface.
To provide custom application information, you can register Spring beans that implement the {spring-boot-actuator-module-code}/info/InfoContributor.java[`InfoContributor`] interface.
The following example contributes an `example` entry with a single value:
@ -1256,7 +1256,7 @@ Spring Boot Actuator provides dependency management and auto-configuration for h
- <<production-ready-metrics-export-statsd,StatsD>>
- <<production-ready-metrics-export-wavefront,Wavefront>>
TIP: To learn more about Micrometer's capabilities, please refer to its https://micrometer.io/docs[reference documentation], in particular the {micrometer-concepts-documentation}[concepts section].
TIP: To learn more about Micrometer's capabilities, please refer to its https://micrometer.io/docs[reference documentation], in particular the {micrometer-concepts-docs}[concepts section].
@ -1320,7 +1320,7 @@ Spring Boot also <<production-ready-metrics-meter,configures built-in instrument
[[production-ready-metrics-export-appoptics]]
==== AppOptics
By default, the AppOptics registry pushes metrics to https://api.appoptics.com/v1/measurements periodically.
To export metrics to SaaS {micrometer-registry-documentation}/appoptics[AppOptics], your API token must be provided:
To export metrics to SaaS {micrometer-registry-docs}/appoptics[AppOptics], your API token must be provided:
[source,properties,indent=0]
----
@ -1331,7 +1331,7 @@ To export metrics to SaaS {micrometer-registry-documentation}/appoptics[AppOptic
[[production-ready-metrics-export-atlas]]
==== Atlas
By default, metrics are exported to {micrometer-registry-documentation}/atlas[Atlas] running on your local machine.
By default, metrics are exported to {micrometer-registry-docs}/atlas[Atlas] running on your local machine.
The location of the https://github.com/Netflix/atlas[Atlas server] to use can be provided using:
[source,properties,indent=0]
@ -1344,7 +1344,7 @@ The location of the https://github.com/Netflix/atlas[Atlas server] to use can be
[[production-ready-metrics-export-datadog]]
==== Datadog
Datadog registry pushes metrics to https://www.datadoghq.com[datadoghq] periodically.
To export metrics to {micrometer-registry-documentation}/datadog[Datadog], your API key must be provided:
To export metrics to {micrometer-registry-docs}/datadog[Datadog], your API key must be provided:
[source,properties,indent=0]
----
@ -1363,7 +1363,7 @@ You can also change the interval at which metrics are sent to Datadog:
[[production-ready-metrics-export-dynatrace]]
==== Dynatrace
Dynatrace registry pushes metrics to the configured URI periodically.
To export metrics to {micrometer-registry-documentation}/dynatrace[Dynatrace], your API token, device ID, and URI must be provided:
To export metrics to {micrometer-registry-docs}/dynatrace[Dynatrace], your API token, device ID, and URI must be provided:
[source,properties,indent=0]
----
@ -1383,7 +1383,7 @@ You can also change the interval at which metrics are sent to Dynatrace:
[[production-ready-metrics-export-elastic]]
==== Elastic
By default, metrics are exported to {micrometer-registry-documentation}/elastic[Elastic] running on your local machine.
By default, metrics are exported to {micrometer-registry-docs}/elastic[Elastic] running on your local machine.
The location of the Elastic server to use can be provided using the following property:
[source,properties,indent=0]
@ -1395,7 +1395,7 @@ The location of the Elastic server to use can be provided using the following pr
[[production-ready-metrics-export-ganglia]]
==== Ganglia
By default, metrics are exported to {micrometer-registry-documentation}/ganglia[Ganglia] running on your local machine.
By default, metrics are exported to {micrometer-registry-docs}/ganglia[Ganglia] running on your local machine.
The http://ganglia.sourceforge.net[Ganglia server] host and port to use can be provided using:
[source,properties,indent=0]
@ -1408,7 +1408,7 @@ The http://ganglia.sourceforge.net[Ganglia server] host and port to use can be p
[[production-ready-metrics-export-graphite]]
==== Graphite
By default, metrics are exported to {micrometer-registry-documentation}/graphite[Graphite] running on your local machine.
By default, metrics are exported to {micrometer-registry-docs}/graphite[Graphite] running on your local machine.
The https://graphiteapp.org[Graphite server] host and port to use can be provided using:
[source,properties,indent=0]
@ -1417,7 +1417,7 @@ The https://graphiteapp.org[Graphite server] host and port to use can be provide
management.metrics.export.graphite.port=9004
----
Micrometer provides a default `HierarchicalNameMapper` that governs how a dimensional meter id is {micrometer-registry-documentation}/graphite#_hierarchical_name_mapping[mapped to flat hierarchical names].
Micrometer provides a default `HierarchicalNameMapper` that governs how a dimensional meter id is {micrometer-registry-docs}/graphite#_hierarchical_name_mapping[mapped to flat hierarchical names].
TIP: To take control over this behaviour, define your `GraphiteMeterRegistry` and supply your own `HierarchicalNameMapper`.
An auto-configured `GraphiteConfig` and `Clock` beans are provided unless you define your own:
@ -1435,7 +1435,7 @@ public GraphiteMeterRegistry graphiteMeterRegistry(GraphiteConfig config, Clock
[[production-ready-metrics-export-humio]]
==== Humio
By default, the Humio registry pushes metrics to https://cloud.humio.com periodically.
To export metrics to SaaS {micrometer-registry-documentation}/humio[Humio], your API token must be provided:
To export metrics to SaaS {micrometer-registry-docs}/humio[Humio], your API token must be provided:
[source,properties,indent=0]
----
@ -1454,7 +1454,7 @@ You should also configure one or more tags to identify the data source to which
[[production-ready-metrics-export-influx]]
==== Influx
By default, metrics are exported to {micrometer-registry-documentation}/influx[Influx] running on your local machine.
By default, metrics are exported to {micrometer-registry-docs}/influx[Influx] running on your local machine.
The location of the https://www.influxdata.com[Influx server] to use can be provided using:
[source,properties,indent=0]
@ -1466,7 +1466,7 @@ The location of the https://www.influxdata.com[Influx server] to use can be prov
[[production-ready-metrics-export-jmx]]
==== JMX
Micrometer provides a hierarchical mapping to {micrometer-registry-documentation}/jmx[JMX], primarily as a cheap and portable way to view metrics locally.
Micrometer provides a hierarchical mapping to {micrometer-registry-docs}/jmx[JMX], primarily as a cheap and portable way to view metrics locally.
By default, metrics are exported to the `metrics` JMX domain.
The domain to use can be provided using:
@ -1475,7 +1475,7 @@ The domain to use can be provided using:
management.metrics.export.jmx.domain=com.example.app.metrics
----
Micrometer provides a default `HierarchicalNameMapper` that governs how a dimensional meter id is {micrometer-registry-documentation}/jmx#_hierarchical_name_mapping[mapped to flat hierarchical names].
Micrometer provides a default `HierarchicalNameMapper` that governs how a dimensional meter id is {micrometer-registry-docs}/jmx#_hierarchical_name_mapping[mapped to flat hierarchical names].
TIP: To take control over this behaviour, define your `JmxMeterRegistry` and supply your own `HierarchicalNameMapper`.
An auto-configured `JmxConfig` and `Clock` beans are provided unless you define your own:
@ -1492,7 +1492,7 @@ public JmxMeterRegistry jmxMeterRegistry(JmxConfig config, Clock clock) {
[[production-ready-metrics-export-kairos]]
==== KairosDB
By default, metrics are exported to {micrometer-registry-documentation}/kairos[KairosDB] running on your local machine.
By default, metrics are exported to {micrometer-registry-docs}/kairos[KairosDB] running on your local machine.
The location of the https://kairosdb.github.io/[KairosDB server] to use can be provided using:
[source,properties,indent=0]
@ -1504,7 +1504,7 @@ The location of the https://kairosdb.github.io/[KairosDB server] to use can be p
[[production-ready-metrics-export-newrelic]]
==== New Relic
New Relic registry pushes metrics to {micrometer-registry-documentation}/new-relic[New Relic] periodically.
New Relic registry pushes metrics to {micrometer-registry-docs}/new-relic[New Relic] periodically.
To export metrics to https://newrelic.com[New Relic], your API key and account id must be provided:
[source,properties,indent=0]
@ -1524,7 +1524,7 @@ You can also change the interval at which metrics are sent to New Relic:
[[production-ready-metrics-export-prometheus]]
==== Prometheus
{micrometer-registry-documentation}/prometheus[Prometheus] expects to scrape or poll individual app instances for metrics.
{micrometer-registry-docs}/prometheus[Prometheus] expects to scrape or poll individual app instances for metrics.
Spring Boot provides an actuator endpoint available at `/actuator/prometheus` to present a https://prometheus.io[Prometheus scrape] with the appropriate format.
TIP: The endpoint is not available by default and must be exposed, see <<production-ready-endpoints-exposing-endpoints,exposing endpoints>> for more details.
@ -1560,7 +1560,7 @@ For advanced configuration, you can also provide your own `PrometheusPushGateway
[[production-ready-metrics-export-signalfx]]
==== SignalFx
SignalFx registry pushes metrics to {micrometer-registry-documentation}/signalfx[SignalFx] periodically.
SignalFx registry pushes metrics to {micrometer-registry-docs}/signalfx[SignalFx] periodically.
To export metrics to https://signalfx.com[SignalFx], your access token must be provided:
[source,properties,indent=0]
@ -1595,7 +1595,7 @@ You can also disable it explicitly:
[[production-ready-metrics-export-statsd]]
==== StatsD
The StatsD registry pushes metrics over UDP to a StatsD agent eagerly.
By default, metrics are exported to a {micrometer-registry-documentation}/statsd[StatsD] agent running on your local machine.
By default, metrics are exported to a {micrometer-registry-docs}/statsd[StatsD] agent running on your local machine.
The StatsD agent host and port to use can be provided using:
[source,properties,indent=0]
@ -1615,7 +1615,7 @@ You can also change the StatsD line protocol to use (default to Datadog):
[[production-ready-metrics-export-wavefront]]
==== Wavefront
Wavefront registry pushes metrics to {micrometer-registry-documentation}/wavefront[Wavefront] periodically.
Wavefront registry pushes metrics to {micrometer-registry-docs}/wavefront[Wavefront] periodically.
If you are exporting metrics to https://www.wavefront.com/[Wavefront] directly, your API token must be provided:
[source,properties,indent=0]
@ -1657,7 +1657,7 @@ Spring Boot registers the following core metrics when applicable:
* Logback metrics: record the number of events logged to Logback at each level
* Uptime metrics: report a gauge for uptime and a fixed gauge representing the application's absolute start time
* Tomcat metrics (`server.tomcat.mbeanregistry.enabled` must be set to `true` for all Tomcat metrics to be registered)
* {spring-integration-reference}#micrometer-integration[Spring Integration] metrics
* {spring-integration-docs}#micrometer-integration[Spring Integration] metrics
@ -1973,7 +1973,7 @@ The following properties allow per-meter customization:
| Publish a cumulative histogram with buckets defined by your SLAs.
|===
For more details on concepts behind `percentiles-histogram`, `percentiles` and `sla` refer to the {micrometer-concepts-documentation}#_histograms_and_percentiles["Histograms and percentiles" section] of the micrometer documentation.
For more details on concepts behind `percentiles-histogram`, `percentiles` and `sla` refer to the {micrometer-concepts-docs}#_histograms_and_percentiles["Histograms and percentiles" section] of the micrometer documentation.
@ -2131,7 +2131,7 @@ include::{code-examples}/cloudfoundry/CloudFoundryCustomContextPathExample.java[
[[production-ready-whats-next]]
== What to Read Next
If you want to explore some of the concepts discussed in this chapter, you can take a look at the actuator {github-code}/spring-boot-samples[sample applications].
If you want to explore some of the concepts discussed in this chapter, you can take a look at the actuator {spring-boot-code}/spring-boot-samples[sample applications].
You also might want to read about graphing tools such as https://graphite.wikidot.com/[Graphite].
Otherwise, you can continue on, to read about <<deployment.adoc#deployment, '`deployment options`'>> or jump ahead for some in-depth information about Spring Boot's _<<build-tool-plugins.adoc#build-tool-plugins, build tool plugins>>_.

@ -160,7 +160,7 @@ The following items are used as "`grab hints`":
| Spring Transaction Management.
|===
TIP: See subclasses of {sc-spring-boot-cli}/compiler/CompilerAutoConfiguration.{sc-ext}[`CompilerAutoConfiguration`] in the Spring Boot CLI source code to understand exactly how customizations are applied.
TIP: See subclasses of {spring-boot-cli-module-code}/compiler/CompilerAutoConfiguration.java[`CompilerAutoConfiguration`] in the Spring Boot CLI source code to understand exactly how customizations are applied.
@ -432,8 +432,8 @@ See https://maven.apache.org/settings.html[Maven's settings documentation] for f
[[cli-whats-next]]
== What to Read Next
There are some {github-code}/spring-boot-project/spring-boot-cli/samples[sample groovy scripts] available from the GitHub repository that you can use to try out the Spring Boot CLI.
There is also extensive Javadoc throughout the {sc-spring-boot-cli}[source code].
There are some {spring-boot-code}/spring-boot-project/spring-boot-cli/samples[sample groovy scripts] available from the GitHub repository that you can use to try out the Spring Boot CLI.
There is also extensive Javadoc throughout the {spring-boot-cli-module-code}[source code].
If you find that you reach the limit of the CLI tool, you probably want to look at converting your application to a full Gradle or Maven built "`Groovy project`".
The next section covers Spring Boot's "<<build-tool-plugins.adoc#build-tool-plugins, Build tool plugins>>", which you can use with Gradle or Maven.

@ -130,7 +130,7 @@ Inside your `banner.txt` file, you can use any of the following placeholders:
| `${Ansi.NAME}` (or `${AnsiColor.NAME}`, `${AnsiBackground.NAME}`, `${AnsiStyle.NAME}`)
| Where `NAME` is the name of an ANSI escape code.
See {sc-spring-boot}/ansi/AnsiPropertySource.{sc-ext}[`AnsiPropertySource`] for details.
See {spring-boot-module-code}/ansi/AnsiPropertySource.java[`AnsiPropertySource`] for details.
| `${application.title}`
| The title of your application, as declared in `MANIFEST.MF`.
@ -166,7 +166,7 @@ In most cases, these are references to `@Configuration` classes, but they could
It is also possible to configure the `SpringApplication` by using an `application.properties` file.
See _<<boot-features-external-config>>_ for details.
For a complete list of the configuration options, see the {dc-spring-boot}/SpringApplication.{dc-ext}[`SpringApplication` Javadoc].
For a complete list of the configuration options, see the {spring-boot-module-api}/SpringApplication.html[`SpringApplication` Javadoc].
@ -183,13 +183,13 @@ include::{code-examples}/builder/SpringApplicationBuilderExample.java[tag=hierar
NOTE: There are some restrictions when creating an `ApplicationContext` hierarchy.
For example, Web components *must* be contained within the child context, and the same `Environment` is used for both parent and child contexts.
See the {dc-spring-boot}/builder/SpringApplicationBuilder.{dc-ext}[`SpringApplicationBuilder` Javadoc] for full details.
See the {spring-boot-module-api}/builder/SpringApplicationBuilder.html[`SpringApplicationBuilder` Javadoc] for full details.
[[boot-features-application-events-and-listeners]]
=== Application Events and Listeners
In addition to the usual Spring Framework events, such as {spring-javadoc}/context/event/ContextRefreshedEvent.{dc-ext}[`ContextRefreshedEvent`], a `SpringApplication` sends some additional application events.
In addition to the usual Spring Framework events, such as {spring-framework-api}/context/event/ContextRefreshedEvent.html[`ContextRefreshedEvent`], a `SpringApplication` sends some additional application events.
[NOTE]
====
@ -330,7 +330,7 @@ When such an exception is encountered, Spring Boot returns the exit code provide
[[boot-features-application-admin]]
=== Admin Features
It is possible to enable admin-related features for the application by specifying the `spring.application.admin.enabled` property.
This exposes the {sc-spring-boot}/admin/SpringApplicationAdminMXBean.{sc-ext}[`SpringApplicationAdminMXBean`] on the platform `MBeanServer`.
This exposes the {spring-boot-module-code}/admin/SpringApplicationAdminMXBean.java[`SpringApplicationAdminMXBean`] on the platform `MBeanServer`.
You could use this feature to administer your Spring Boot application remotely.
This feature could also be useful for any service wrapper implementation.
@ -350,8 +350,9 @@ Spring Boot uses a very particular `PropertySource` order that is designed to al
Properties are considered in the following order:
. <<using-boot-devtools-globalsettings,Devtools global settings properties>> in the `$HOME/.config/spring-boot` folder when devtools is active.
. {spring-javadoc}/test/context/TestPropertySource.{dc-ext}[`@TestPropertySource`] annotations on your tests.
. `properties` attribute on your tests. Available on {dc-spring-boot-test}/context/SpringBootTest.{dc-ext}[`@SpringBootTest`] and the <<boot-features-testing-spring-boot-applications-testing-autoconfigured-tests,test annotations for testing a particular slice of your application>>.
. {spring-framework-api}/test/context/TestPropertySource.html[`@TestPropertySource`] annotations on your tests.
. `properties` attribute on your tests.
Available on {spring-boot-test-module-api}/context/SpringBootTest.html[`@SpringBootTest`] and the <<boot-features-testing-spring-boot-applications-testing-autoconfigured-tests,test annotations for testing a particular slice of your application>>.
. Command line arguments.
. Properties from `SPRING_APPLICATION_JSON` (inline JSON embedded in an environment variable or system property).
. `ServletConfig` init parameters.
@ -364,7 +365,7 @@ Properties are considered in the following order:
. <<boot-features-external-config-profile-specific-properties,Profile-specific application properties>> packaged inside your jar (`application-\{profile}.properties` and YAML variants).
. Application properties outside of your packaged jar (`application.properties` and YAML variants).
. Application properties packaged inside your jar (`application.properties` and YAML variants).
. {spring-javadoc}/context/annotation/PropertySource.{dc-ext}[`@PropertySource`] annotations on your `@Configuration` classes.
. {spring-framework-api}/context/annotation/PropertySource.html[`@PropertySource`] annotations on your `@Configuration` classes.
. Default properties (specified by setting `SpringApplication.setDefaultProperties`).
To provide a concrete example, suppose you develop a `@Component` that uses a `name` property, as shown in the following example:
@ -668,7 +669,7 @@ If the `development`, `production` and `eu-central` profiles are *not* enabled,
====
`spring.profiles` can therefore contain a simple profile name (for example `production`) or a profile expression.
A profile expression allows for more complicated profile logic to be expressed, for example `production & (eu-central | eu-west)`.
Check the {spring-reference}core.html#beans-definition-profiles-java[reference guide] for more details.
Check the {spring-framework-docs}core.html#beans-definition-profiles-java[reference guide] for more details.
====
If none are explicitly active when the application context starts, the default profiles are activated.
@ -1230,7 +1231,7 @@ Spring Boot has dedicated support for expressing durations.
If you expose a `java.time.Duration` property, the following formats in application properties are available:
* A regular `long` representation (using milliseconds as the default unit unless a `@DurationUnit` has been specified)
* The standard ISO-8601 format {java-javadoc}/java/time/Duration.html#parse-java.lang.CharSequence-[used by `java.time.Duration`]
* The standard ISO-8601 format {java-api}/java/time/Duration.html#parse-java.lang.CharSequence-[used by `java.time.Duration`]
* A more readable format where the value and the unit are coupled (e.g. `10s` means 10 seconds)
Consider the following example:
@ -1425,7 +1426,7 @@ This means that you can specify active profiles in `application.properties` and
Sometimes, it is useful to have profile-specific properties that *add* to the active profiles rather than replace them.
The `spring.profiles.include` property can be used to unconditionally add active profiles.
The `SpringApplication` entry point also has a Java API for setting additional profiles (that is, on top of those activated by the `spring.profiles.active` property).
See the `setAdditionalProfiles()` method in {dc-spring-boot}/SpringApplication.html[SpringApplication].
See the `setAdditionalProfiles()` method in {spring-boot-module-api}/SpringApplication.html[SpringApplication].
For example, when an application with the following properties is run by using the switch, `--spring.profiles.active=prod`, the `proddb` and `prodmq` profiles are also activated:
@ -1462,7 +1463,7 @@ See "<<boot-features-external-config-profile-specific-properties>>" for details.
[[boot-features-logging]]
== Logging
Spring Boot uses https://commons.apache.org/logging[Commons Logging] for all internal logging but leaves the underlying log implementation open.
Default configurations are provided for {java-javadoc}/java/util/logging/package-summary.html[Java Util Logging], https://logging.apache.org/log4j/2.x/[Log4J2], and https://logback.qos.ch/[Logback].
Default configurations are provided for {java-api}/java/util/logging/package-summary.html[Java Util Logging], https://logging.apache.org/log4j/2.x/[Log4J2], and https://logback.qos.ch/[Logback].
In each case, loggers are pre-configured to use console output with optional file output also available.
By default, if you use the "`Starters`", Logback is used for logging. Appropriate Logback routing is also included to ensure that dependent libraries that use Java Util Logging, Commons Logging, Log4J, or SLF4J all work correctly.
@ -1523,7 +1524,7 @@ Doing so enables trace logging for a selection of core loggers (embedded contain
[[boot-features-logging-color-coded-output]]
==== Color-coded Output
If your terminal supports ANSI, color output is used to aid readability.
You can set `spring.output.ansi.enabled` to a {dc-spring-boot}/ansi/AnsiOutput.Enabled.{dc-ext}[supported value] to override the auto-detection.
You can set `spring.output.ansi.enabled` to a {spring-boot-module-api}/ansi/AnsiOutput.Enabled.html[supported value] to override the auto-detection.
Color coding is configured by using the `%clr` conversion word.
In its simplest form, the converter colors the output according to the log level, as shown in the following example:
@ -1770,9 +1771,9 @@ To help with the customization, some other properties are transferred from the S
All the supported logging systems can consult System properties when parsing their configuration files.
See the default configurations in `spring-boot.jar` for examples:
* {github-code}/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback/defaults.xml[Logback]
* {github-code}/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/log4j2/log4j2.xml[Log4j 2]
* {github-code}/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/java/logging-file.properties[Java Util logging]
* {spring-boot-code}/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback/defaults.xml[Logback]
* {spring-boot-code}/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/log4j2/log4j2.xml[Log4j 2]
* {spring-boot-code}/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/java/logging-file.properties[Java Util logging]
[TIP]
====
@ -1819,7 +1820,7 @@ Profile sections are supported anywhere within the `<configuration>` element.
Use the `name` attribute to specify which profile accepts the configuration.
The `<springProfile>` tag can contain a simple profile name (for example `staging`) or a profile expression.
A profile expression allows for more complicated profile logic to be expressed, for example `production & (eu-central | eu-west)`.
Check the {spring-reference}core.html#beans-definition-profiles-java[reference guide] for more details.
Check the {spring-framework-docs}core.html#beans-definition-profiles-java[reference guide] for more details.
The following listing shows three sample profiles:
[source,xml,indent=0]
@ -1882,7 +1883,7 @@ The basename of the resource bundle as well as several other attributes can be c
TIP: `spring.messages.basename` supports comma-separated list of locations, either a package qualifier or a resource resolved from the classpath root.
See {sc-spring-boot-autoconfigure}/context/MessageSourceProperties.{sc-ext}[`MessageSourceProperties`] for more supported options.
See {spring-boot-autoconfigure-module-code}/context/MessageSourceProperties.java[`MessageSourceProperties`] for more supported options.
@ -1936,7 +1937,7 @@ If you have not yet developed a Spring Boot web application, you can follow the
[[boot-features-spring-mvc]]
=== The "`Spring Web MVC Framework`"
The {spring-reference}web.html#mvc[Spring Web MVC framework] (often referred to as simply "`Spring MVC`") is a rich "`model view controller`" web framework.
The {spring-framework-docs}web.html#mvc[Spring Web MVC framework] (often referred to as simply "`Spring MVC`") is a rich "`model view controller`" web framework.
Spring MVC lets you create special `@Controller` or `@RestController` beans to handle incoming HTTP requests.
Methods in your controller are mapped to HTTP by using `@RequestMapping` annotations.
@ -1966,7 +1967,7 @@ The following code shows a typical `@RestController` that serves JSON data:
}
----
Spring MVC is part of the core Spring Framework, and detailed information is available in the {spring-reference}web.html#mvc[reference documentation].
Spring MVC is part of the core Spring Framework, and detailed information is available in the {spring-framework-docs}web.html#mvc[reference documentation].
There are also several guides that cover Spring MVC available at https://spring.io/guides.
@ -1986,7 +1987,7 @@ The auto-configuration adds the following features on top of Spring's defaults:
* Custom `Favicon` support (covered <<boot-features-spring-mvc-favicon,later in this document>>).
* Automatic use of a `ConfigurableWebBindingInitializer` bean (covered <<boot-features-spring-mvc-web-binding-initializer,later in this document>>).
If you want to keep Spring Boot MVC features and you want to add additional {spring-reference}web.html#mvc[MVC configuration] (interceptors, formatters, view controllers, and other features), you can add your own `@Configuration` class of type `WebMvcConfigurer` but *without* `@EnableWebMvc`.
If you want to keep Spring Boot MVC features and you want to add additional {spring-framework-docs}web.html#mvc[MVC configuration] (interceptors, formatters, view controllers, and other features), you can add your own `@Configuration` class of type `WebMvcConfigurer` but *without* `@EnableWebMvc`.
If you wish to provide custom instances of `RequestMappingHandlerMapping`, `RequestMappingHandlerAdapter`, or `ExceptionHandlerExceptionResolver`, you can declare a `WebMvcRegistrationsAdapter` instance to provide such components.
If you want to take complete control of Spring MVC, you can add your own `@Configuration` annotated with `@EnableWebMvc`.
@ -2056,15 +2057,15 @@ You can also use it on classes that contain serializers/deserializers as inner c
All `@JsonComponent` beans in the `ApplicationContext` are automatically registered with Jackson.
Because `@JsonComponent` is meta-annotated with `@Component`, the usual component-scanning rules apply.
Spring Boot also provides {sc-spring-boot}/jackson/JsonObjectSerializer.{sc-ext}[`JsonObjectSerializer`] and {sc-spring-boot}/jackson/JsonObjectDeserializer.{sc-ext}[`JsonObjectDeserializer`] base classes that provide useful alternatives to the standard Jackson versions when serializing objects.
See {dc-spring-boot}/jackson/JsonObjectSerializer.{dc-ext}[`JsonObjectSerializer`] and {dc-spring-boot}/jackson/JsonObjectDeserializer.{dc-ext}[`JsonObjectDeserializer`] in the Javadoc for details.
Spring Boot also provides {spring-boot-module-code}/jackson/JsonObjectSerializer.java[`JsonObjectSerializer`] and {spring-boot-module-code}/jackson/JsonObjectDeserializer.java[`JsonObjectDeserializer`] base classes that provide useful alternatives to the standard Jackson versions when serializing objects.
See {spring-boot-module-api}/jackson/JsonObjectSerializer.html[`JsonObjectSerializer`] and {spring-boot-module-api}/jackson/JsonObjectDeserializer.html[`JsonObjectDeserializer`] in the Javadoc for details.
[[boot-features-spring-message-codes]]
==== MessageCodesResolver
Spring MVC has a strategy for generating error codes for rendering error messages from binding errors: `MessageCodesResolver`.
If you set the `spring.mvc.message-codes-resolver.format` property `PREFIX_ERROR_CODE` or `POSTFIX_ERROR_CODE`, Spring Boot creates one for you (see the enumeration in {spring-javadoc}/validation/DefaultMessageCodesResolver.Format.{dc-ext}[`DefaultMessageCodesResolver.Format`]).
If you set the `spring.mvc.message-codes-resolver.format` property `PREFIX_ERROR_CODE` or `POSTFIX_ERROR_CODE`, Spring Boot creates one for you (see the enumeration in {spring-framework-api}/validation/DefaultMessageCodesResolver.Format.html[`DefaultMessageCodesResolver.Format`]).
@ -2111,7 +2112,7 @@ To use cache busting, the following configuration configures a cache busting sol
NOTE: Links to resources are rewritten in templates at runtime, thanks to a `ResourceUrlEncodingFilter` that is auto-configured for Thymeleaf and FreeMarker.
You should manually declare this filter when using JSPs.
Other template engines are currently not automatically supported but can be with custom template macros/helpers and the use of the {spring-javadoc}/web/servlet/resource/ResourceUrlProvider.{dc-ext}[`ResourceUrlProvider`].
Other template engines are currently not automatically supported but can be with custom template macros/helpers and the use of the {spring-framework-api}/web/servlet/resource/ResourceUrlProvider.html[`ResourceUrlProvider`].
When loading resources dynamically with, for example, a JavaScript module loader, renaming files is not an option.
That is why other strategies are also supported and can be combined. A "fixed" strategy adds a static version string in the URL without changing the file name, as shown in the following example:
@ -2127,11 +2128,11 @@ That is why other strategies are also supported and can be combined. A "fixed" s
With this configuration, JavaScript modules located under `"/js/lib/"` use a fixed versioning strategy (`"/v12/js/lib/mymodule.js"`), while other resources still use the content one (`<link href="/css/spring-2a2d595e6ed9a0b24f027f2b63b134d6.css"/>`).
See {sc-spring-boot-autoconfigure}/web/ResourceProperties.{sc-ext}[`ResourceProperties`] for more supported options.
See {spring-boot-autoconfigure-module-code}/web/ResourceProperties.java[`ResourceProperties`] for more supported options.
[TIP]
====
This feature has been thoroughly described in a dedicated https://spring.io/blog/2014/07/24/spring-framework-4-1-handling-static-web-resources[blog post] and in Spring Framework's {spring-reference}web.html#mvc-config-static-resources[reference documentation].
This feature has been thoroughly described in a dedicated https://spring.io/blog/2014/07/24/spring-framework-4-1-handling-static-web-resources[blog post] and in Spring Framework's {spring-framework-docs}web.html#mvc-config-static-resources[reference documentation].
====
[[boot-features-spring-mvc-welcome-page]]
@ -2154,7 +2155,7 @@ If such a file is present, it is automatically used as the favicon of the applic
Spring MVC can map incoming HTTP requests to handlers by looking at the request path and matching it to the mappings defined in your application (for example, `@GetMapping` annotations on Controller methods).
Spring Boot chooses to disable suffix pattern matching by default, which means that requests like `"GET /projects/spring-boot.json"` won't be matched to `@GetMapping("/projects/spring-boot")` mappings.
This is considered as a {spring-reference}web.html#mvc-ann-requestmapping-suffix-pattern-match[best practice for Spring MVC applications].
This is considered as a {spring-framework-docs}web.html#mvc-ann-requestmapping-suffix-pattern-match[best practice for Spring MVC applications].
This feature was mainly useful in the past for HTTP clients which did not send proper "Accept" request headers; we needed to make sure to send the correct Content Type to the client.
Nowadays, Content Negotiation is much more reliable.
@ -2319,7 +2320,7 @@ For more complex mappings, you can also add beans that implement the `ErrorViewR
----
You can also use regular Spring MVC features such as {spring-reference}web.html#mvc-exceptionhandlers[`@ExceptionHandler` methods] and {spring-reference}web.html#mvc-ann-controller-advice[`@ControllerAdvice`].
You can also use regular Spring MVC features such as {spring-framework-docs}web.html#mvc-exceptionhandlers[`@ExceptionHandler` methods] and {spring-framework-docs}web.html#mvc-ann-controller-advice[`@ControllerAdvice`].
The `ErrorController` then picks up any unhandled exceptions.
@ -2389,9 +2390,9 @@ Note that doing so disables the `ObjectMapper` customization described earlier.
==== CORS Support
https://en.wikipedia.org/wiki/Cross-origin_resource_sharing[Cross-origin resource sharing] (CORS) is a https://www.w3.org/TR/cors/[W3C specification] implemented by https://caniuse.com/#feat=cors[most browsers] that lets you specify in a flexible way what kind of cross-domain requests are authorized., instead of using some less secure and less powerful approaches such as IFRAME or JSONP.
As of version 4.2, Spring MVC {spring-reference}web.html#cors[supports CORS].
Using {spring-reference}web.html#controller-method-cors-configuration[controller method CORS configuration] with {spring-javadoc}/web/bind/annotation/CrossOrigin.{dc-ext}[`@CrossOrigin`] annotations in your Spring Boot application does not require any specific configuration.
{spring-reference}web.html#global-cors-configuration[Global CORS configuration] can be defined by registering a `WebMvcConfigurer` bean with a customized `addCorsMappings(CorsRegistry)` method, as shown in the following example:
As of version 4.2, Spring MVC {spring-framework-docs}web.html#cors[supports CORS].
Using {spring-framework-docs}web.html#controller-method-cors-configuration[controller method CORS configuration] with {spring-framework-api}/web/bind/annotation/CrossOrigin.html[`@CrossOrigin`] annotations in your Spring Boot application does not require any specific configuration.
{spring-framework-docs}web.html#global-cors-configuration[Global CORS configuration] can be defined by registering a `WebMvcConfigurer` bean with a customized `addCorsMappings(CorsRegistry)` method, as shown in the following example:
[source,java,indent=0]
----
@ -2477,7 +2478,7 @@ The annotation-based one is quite close to the Spring MVC model, as shown in the
}
----
WebFlux is part of the Spring Framework and detailed information is available in its {spring-reference}web-reactive.html#webflux-fn[reference documentation].
WebFlux is part of the Spring Framework and detailed information is available in its {spring-framework-docs}web-reactive.html#webflux-fn[reference documentation].
TIP: You can define as many `RouterFunction` beans as you like to modularize the definition of the router.
Beans can be ordered if you need to apply a precedence.
@ -2499,7 +2500,7 @@ The auto-configuration adds the following features on top of Spring's defaults:
* Configuring codecs for `HttpMessageReader` and `HttpMessageWriter` instances (described <<boot-features-webflux-httpcodecs,later in this document>>).
* Support for serving static resources, including support for WebJars (described <<boot-features-spring-mvc-static-content,later in this document>>).
If you want to keep Spring Boot WebFlux features and you want to add additional {spring-reference}web.html#web-reactive[WebFlux configuration], you can add your own `@Configuration` class of type `WebFluxConfigurer` but *without* `@EnableWebFlux`.
If you want to keep Spring Boot WebFlux features and you want to add additional {spring-framework-docs}web.html#web-reactive[WebFlux configuration], you can add your own `@Configuration` class of type `WebFluxConfigurer` but *without* `@EnableWebFlux`.
If you want to take complete control of Spring WebFlux, you can add your own `@Configuration` annotated with `@EnableWebFlux`.
@ -2807,7 +2808,7 @@ Spring Boot tries as much as possible to expose common settings, but this is not
For those cases, dedicated namespaces offer server-specific customizations (see `server.tomcat` and `server.undertow`).
For instance, <<howto.adoc#howto-configure-accesslogs,access logs>> can be configured with specific features of the embedded servlet container.
TIP: See the {sc-spring-boot-autoconfigure}/web/ServerProperties.{sc-ext}[`ServerProperties`] class for a complete list.
TIP: See the {spring-boot-autoconfigure-module-code}/web/ServerProperties.java[`ServerProperties`] class for a complete list.
@ -2856,7 +2857,7 @@ If the preceding customization techniques are too limited, you can register the
Setters are provided for many configuration options.
Several protected method "`hooks`" are also provided should you need to do something more exotic.
See the {dc-spring-boot}/web/servlet/server/ConfigurableServletWebServerFactory.{dc-ext}[source code documentation] for details.
See the {spring-boot-module-api}/web/servlet/server/ConfigurableServletWebServerFactory.html[source code documentation] for details.
@ -2873,7 +2874,7 @@ When running a Spring Boot application that uses an embedded servlet container (
* Creating a custom `error.jsp` page does not override the default view for <<boot-features-error-handling,error handling>>.
<<boot-features-error-handling-custom-error-pages,Custom error pages>> should be used instead.
There is a {github-code}/spring-boot-samples/spring-boot-sample-web-jsp[JSP sample] so that you can see how to set things up.
There is a {spring-boot-code}/spring-boot-samples/spring-boot-sample-web-jsp[JSP sample] so that you can see how to set things up.
@ -3026,7 +3027,7 @@ The following code shows a typical example:
If {spring-security}[Spring Security] is on the classpath, then web applications are secured by default.
Spring Boot relies on Spring Securitys content-negotiation strategy to determine whether to use `httpBasic` or `formLogin`.
To add method-level security to a web application, you can also add `@EnableGlobalMethodSecurity` with your desired settings.
Additional information can be found in the {spring-security-reference}#jc-method[Spring Security Reference Guide].
Additional information can be found in the {spring-security-docs}#jc-method[Spring Security Reference Guide].
The default `UserDetailsService` has a single user. The user name is `user`, and the password is random and is printed at INFO level when the application starts, as shown in the following example:
@ -3042,7 +3043,7 @@ You can change the username and password by providing a `spring.security.user.na
The basic features you get by default in a web application are:
* A `UserDetailsService` (or `ReactiveUserDetailsService` in case of a WebFlux application) bean with in-memory store and a single user with a generated password (see {dc-spring-boot}/autoconfigure/security/SecurityProperties.User.html[`SecurityProperties.User`] for the properties of the user).
* A `UserDetailsService` (or `ReactiveUserDetailsService` in case of a WebFlux application) bean with in-memory store and a single user with a generated password (see {spring-boot-module-api}/autoconfigure/security/SecurityProperties.User.html[`SecurityProperties.User`] for the properties of the user).
* Form-based login or HTTP Basic security (depending on the `Accept` header in the request) for the entire application (including actuator endpoints if actuator is on the classpath).
* A `DefaultAuthenticationEventPublisher` for publishing authentication events.
@ -3248,7 +3249,7 @@ This means that the actuator endpoints that require a `POST` (shutdown and logge
NOTE: We recommend disabling CSRF protection completely only if you are creating a service that is used by non-browser clients.
Additional information about CSRF protection can be found in the {spring-security-reference}#csrf[Spring Security Reference Guide].
Additional information about CSRF protection can be found in the {spring-security-docs}#csrf[Spring Security Reference Guide].
@ -3347,7 +3348,7 @@ TIP: You often do not need to specify the `driver-class-name`, since Spring Boot
NOTE: For a pooling `DataSource` to be created, we need to be able to verify that a valid `Driver` class is available, so we check for that before doing anything.
In other words, if you set `spring.datasource.driver-class-name=com.mysql.jdbc.Driver`, then that class has to be loadable.
See {sc-spring-boot-autoconfigure}/jdbc/DataSourceProperties.{sc-ext}[`DataSourceProperties`] for more of the supported options.
See {spring-boot-autoconfigure-module-code}/jdbc/DataSourceProperties.java[`DataSourceProperties`] for more of the supported options.
These are the standard options that work regardless of the actual implementation.
It is also possible to fine-tune implementation-specific settings by using their respective prefix (`+spring.datasource.hikari.*+`, `+spring.datasource.tomcat.*+`, and `+spring.datasource.dbcp2.*+`).
Refer to the documentation of the connection pool implementation you are using for more details.
@ -3498,9 +3499,9 @@ See the "`<<howto.adoc#howto-separate-entity-definitions-from-spring-configurati
JPA queries are created automatically from your method names.
For example, a `CityRepository` interface might declare a `findAllByState(String state)` method to find all the cities in a given state.
For more complex queries, you can annotate your method with Spring Data's {spring-data-javadoc}/repository/Query.html[`Query`] annotation.
For more complex queries, you can annotate your method with Spring Data's {spring-data-jpa-api}/repository/Query.html[`Query`] annotation.
Spring Data repositories usually extend from the {spring-data-commons-javadoc}/repository/Repository.html[`Repository`] or {spring-data-commons-javadoc}/repository/CrudRepository.html[`CrudRepository`] interfaces.
Spring Data repositories usually extend from the {spring-data-commons-api}/repository/Repository.html[`Repository`] or {spring-data-commons-api}/repository/CrudRepository.html[`CrudRepository`] interfaces.
If you use auto-configuration, repositories are searched from the package containing your main configuration class (the one annotated with `@EnableAutoConfiguration` or `@SpringBootApplication`) down.
The following example shows a typical Spring Data repository interface definition:
@ -3560,7 +3561,7 @@ There is also a `spring.jpa.generate-ddl` flag, but it is not used if Hibernate
[[boot-features-jpa-in-web-environment]]
==== Open EntityManager in View
If you are running a web application, Spring Boot by default registers {spring-javadoc}/orm/jpa/support/OpenEntityManagerInViewInterceptor.{dc-ext}[`OpenEntityManagerInViewInterceptor`] to apply the "`Open EntityManager in View`" pattern, to allow for lazy loading in web views.
If you are running a web application, Spring Boot by default registers {spring-framework-api}/orm/jpa/support/OpenEntityManagerInViewInterceptor.html[`OpenEntityManagerInViewInterceptor`] to apply the "`Open EntityManager in View`" pattern, to allow for lazy loading in web views.
If you do not want this behavior, you should set `spring.jpa.open-in-view` to `false` in your `application.properties`.
@ -3608,7 +3609,7 @@ Both the commercial and open source editions can be used with Spring Boot.
==== Code Generation
In order to use jOOQ type-safe queries, you need to generate Java classes from your database schema.
You can follow the instructions in the {jooq-manual}/#jooq-in-7-steps-step3[jOOQ user manual].
You can follow the instructions in the {jooq-docs}/#jooq-in-7-steps-step3[jOOQ user manual].
If you use the `jooq-codegen-maven` plugin and you also use the `spring-boot-starter-parent` "`parent POM`", you can safely omit the plugin's `<version>` tag.
You can also use Spring Boot-defined version variables (such as `h2.version`) to declare the plugin's database dependency. The following listing shows an example:
@ -3706,15 +3707,15 @@ You can also create your own `org.jooq.Configuration` `@Bean` if you want to tak
== Working with NoSQL Technologies
Spring Data provides additional projects that help you access a variety of NoSQL technologies, including:
* https://projects.spring.io/spring-data-mongodb/[MongoDB]
* https://projects.spring.io/spring-data-neo4j/[Neo4J]
* https://github.com/spring-projects/spring-data-elasticsearch/[Elasticsearch]
* https://projects.spring.io/spring-data-solr/[Solr]
* https://projects.spring.io/spring-data-redis/[Redis]
* https://projects.spring.io/spring-data-gemfire/[Gemfire] or https://projects.spring.io/spring-data-geode/[Geode]
* https://projects.spring.io/spring-data-cassandra/[Cassandra]
* https://projects.spring.io/spring-data-couchbase/[Couchbase]
* https://projects.spring.io/spring-data-ldap/[LDAP]
* https://spring.io/projects/spring-data-mongodb[MongoDB]
* https://spring.io/projects/spring-data-neo4j[Neo4J]
* https://spring.io/projects/spring-data-elasticsearch[Elasticsearch]
* https://spring.io/projects/spring-data-solr[Solr]
* https://spring.io/projects/spring-data-redis[Redis]
* https://spring.io/projects/spring-data-gemfire[Gemfire] or https://spring.io/projects/spring-data-geode[Geode]
* https://spring.io/projects/spring-data-cassandra[Cassandra]
* https://spring.io/projects/spring-data-couchbase[Couchbase]
* https://spring.io/projects/spring-data-ldap[LDAP]
Spring Boot provides auto-configuration for Redis, MongoDB, Neo4j, Elasticsearch, Solr Cassandra, Couchbase, and LDAP.
You can make use of the other projects, but you must configure them yourself.
@ -3839,7 +3840,7 @@ The auto-configuration configures this factory automatically if Netty is availab
[[boot-features-mongo-template]]
==== MongoTemplate
{spring-data-mongo}[Spring Data MongoDB] provides a {spring-data-mongo-javadoc}/core/MongoTemplate.html[`MongoTemplate`] class that is very similar in its design to Spring's `JdbcTemplate`.
{spring-data-mongodb}[Spring Data MongoDB] provides a {spring-data-mongodb-api}/core/MongoTemplate.html[`MongoTemplate`] class that is very similar in its design to Spring's `JdbcTemplate`.
As with `JdbcTemplate`, Spring Boot auto-configures a bean for you to inject the template, as follows:
[source,java,indent=0]
@ -3863,11 +3864,12 @@ As with `JdbcTemplate`, Spring Boot auto-configures a bean for you to inject the
}
----
See the https://docs.spring.io/spring-data/mongodb/docs/current/api/org/springframework/data/mongodb/core/MongoOperations.html[`MongoOperations` Javadoc] for complete details.
See the {spring-data-mongodb-api}/core/MongoOperations.html[`MongoOperations` Javadoc] for complete details.
[[boot-features-spring-data-mongo-repositories]]
[[boot-features-spring-data-mongodb-repositories]]
==== Spring Data MongoDB Repositories
Spring Data includes repository support for MongoDB.
As with the JPA repositories discussed earlier, the basic principle is that queries are constructed automatically, based on method names.
@ -3893,7 +3895,7 @@ You could take the JPA example from earlier and, assuming that `City` is now a M
TIP: You can customize document scanning locations by using the `@EntityScan` annotation.
TIP: For complete details of Spring Data MongoDB, including its rich object mapping technologies, refer to its https://projects.spring.io/spring-data-mongodb/[reference documentation].
TIP: For complete details of Spring Data MongoDB, including its rich object mapping technologies, refer to its {spring-data-mongodb}[reference documentation].
@ -4201,7 +4203,7 @@ As with the JPA repositories discussed earlier, the basic principle is that quer
In fact, both Spring Data JPA and Spring Data Elasticsearch share the same common infrastructure.
You could take the JPA example from earlier and, assuming that `City` is now an Elasticsearch `@Document` class rather than a JPA `@Entity`, it works in the same way.
TIP: For complete details of Spring Data Elasticsearch, refer to the {spring-data-elasticsearch-reference}[reference documentation].
TIP: For complete details of Spring Data Elasticsearch, refer to the {spring-data-elasticsearch-docs}[reference documentation].
Spring Boot supports both classic and reactive Elasticsearch repositories, using the `ElasticsearchRestTemplate` or `ReactiveElasticsearchTemplate` beans.
Most likely those beans are auto-configured by Spring Boot given the required dependencies are present.
@ -4495,7 +4497,7 @@ At its core, the abstraction applies caching to methods, thus reducing the numbe
The caching logic is applied transparently, without any interference to the invoker.
Spring Boot auto-configures the cache infrastructure as long as caching support is enabled via the `@EnableCaching` annotation.
NOTE: Check the {spring-reference}integration.html#cache[relevant section] of the Spring Framework reference for more details.
NOTE: Check the {spring-framework-docs}integration.html#cache[relevant section] of the Spring Framework reference for more details.
In a nutshell, adding caching to an operation of your service is as easy as adding the relevant annotation to its method, as shown in the following example:
@ -4530,7 +4532,7 @@ When you have made up your mind about the cache provider to use, please make sur
Nearly all providers require you to explicitly configure every cache that you use in the application.
Some offer a way to customize the default caches defined by the `spring.cache.cache-names` property.
TIP: It is also possible to transparently {spring-reference}integration.html#cache-annotations-put[update] or {spring-reference}integration.html#cache-annotations-evict[evict] data from the cache.
TIP: It is also possible to transparently {spring-framework-docs}integration.html#cache-annotations-put[update] or {spring-framework-docs}integration.html#cache-annotations-evict[evict] data from the cache.
@ -4538,7 +4540,7 @@ TIP: It is also possible to transparently {spring-reference}integration.html#cac
=== Supported Cache Providers
The cache abstraction does not provide an actual store and relies on abstraction materialized by the `org.springframework.cache.Cache` and `org.springframework.cache.CacheManager` interfaces.
If you have not defined a bean of type `CacheManager` or a `CacheResolver` named `cacheResolver` (see {spring-javadoc}/cache/annotation/CachingConfigurer.html[`CachingConfigurer`]), Spring Boot tries to detect the following providers (in the indicated order):
If you have not defined a bean of type `CacheManager` or a `CacheResolver` named `cacheResolver` (see {spring-framework-api}/cache/annotation/CachingConfigurer.html[`CachingConfigurer`]), Spring Boot tries to detect the following providers (in the indicated order):
. <<boot-features-caching-provider-generic,Generic>>
. <<boot-features-caching-provider-jcache,JCache (JSR-107)>> (EhCache 3, Hazelcast, Infinispan, and others)
@ -4790,7 +4792,7 @@ Spring Boot also has support for Apache Kafka.
=== JMS
The `javax.jms.ConnectionFactory` interface provides a standard method of creating a `javax.jms.Connection` for interacting with a JMS broker.
Although Spring needs a `ConnectionFactory` to work with JMS, you generally need not use it directly yourself and can instead rely on higher level messaging abstractions.
(See the {spring-reference}integration.html#jms[relevant section] of the Spring Framework reference documentation for details.)
(See the {spring-framework-docs}integration.html#jms[relevant section] of the Spring Framework reference documentation for details.)
Spring Boot also auto-configures the necessary infrastructure to send and receive messages.
@ -4827,7 +4829,7 @@ If you'd rather use native pooling, you can do so by adding a dependency to `org
spring.activemq.pool.max-connections=50
----
TIP: See {sc-spring-boot-autoconfigure}/jms/activemq/ActiveMQProperties.{sc-ext}[`ActiveMQProperties`] for more of the supported options.
TIP: See {spring-boot-autoconfigure-module-code}/jms/activemq/ActiveMQProperties.java[`ActiveMQProperties`] for more of the supported options.
You can also register an arbitrary number of beans that implement `ActiveMQConnectionFactoryCustomizer` for more advanced customizations.
By default, ActiveMQ creates a destination if it does not yet exist so that destinations are resolved against their provided names.
@ -4873,7 +4875,7 @@ If you'd rather use native pooling, you can do so by adding a dependency to `org
spring.artemis.pool.max-connections=50
----
See {sc-spring-boot-autoconfigure}/jms/artemis/ArtemisProperties.{sc-ext}[`ArtemisProperties`] for more supported options.
See {spring-boot-autoconfigure-module-code}/jms/artemis/ArtemisProperties.java[`ArtemisProperties`] for more supported options.
No JNDI lookup is involved, and destinations are resolved against their names, using either the `name` attribute in the Artemis configuration or the names provided through configuration.
@ -4916,7 +4918,7 @@ Spring's `JmsTemplate` is auto-configured, and you can autowire it directly into
}
----
NOTE: {spring-javadoc}/jms/core/JmsMessagingTemplate.{dc-ext}[`JmsMessagingTemplate`] can be injected in a similar manner.
NOTE: {spring-framework-api}/jms/core/JmsMessagingTemplate.html[`JmsMessagingTemplate`] can be injected in a similar manner.
If a `DestinationResolver` or a `MessageConverter` bean is defined, it is associated automatically to the auto-configured `JmsTemplate`.
@ -4949,7 +4951,7 @@ The following component creates a listener endpoint on the `someQueue` destinati
}
----
TIP: See {spring-javadoc}/jms/annotation/EnableJms.{dc-ext}[the Javadoc of `@EnableJms`] for more details.
TIP: See {spring-framework-api}/jms/annotation/EnableJms.html[the Javadoc of `@EnableJms`] for more details.
If you need to create more `JmsListenerContainerFactory` instances or if you want to override the default, Spring Boot provides a `DefaultJmsListenerContainerFactoryConfigurer` that you can use to initialize a `DefaultJmsListenerContainerFactory` with the same settings as the one that is auto-configured.
@ -5016,7 +5018,7 @@ For example, you might declare the following section in `application.properties`
----
If a `ConnectionNameStrategy` bean exists in the context, it will be automatically used to name connections created by the auto-configured `ConnectionFactory`.
See {sc-spring-boot-autoconfigure}/amqp/RabbitProperties.{sc-ext}[`RabbitProperties`] for more of the supported options.
See {spring-boot-autoconfigure-module-code}/amqp/RabbitProperties.java[`RabbitProperties`] for more of the supported options.
TIP: See https://spring.io/blog/2010/06/14/understanding-amqp-the-protocol-used-by-rabbitmq/[Understanding AMQP, the protocol used by RabbitMQ] for more details.
@ -5050,7 +5052,7 @@ Spring's `AmqpTemplate` and `AmqpAdmin` are auto-configured, and you can autowir
}
----
NOTE: {spring-amqp-javadoc}/rabbit/core/RabbitMessagingTemplate.{dc-ext}[`RabbitMessagingTemplate`] can be injected in a similar manner.
NOTE: {spring-amqp-api}/rabbit/core/RabbitMessagingTemplate.html[`RabbitMessagingTemplate`] can be injected in a similar manner.
If a `MessageConverter` bean is defined, it is associated automatically to the auto-configured `AmqpTemplate`.
If necessary, any `org.springframework.amqp.core.Queue` that is defined as a bean is automatically used to declare a corresponding queue on the RabbitMQ instance.
@ -5089,7 +5091,7 @@ The following sample component creates a listener endpoint on the `someQueue` qu
}
----
TIP: See {spring-amqp-javadoc}/rabbit/annotation/EnableRabbit.{dc-ext}[the Javadoc of `@EnableRabbit`] for more details.
TIP: See {spring-amqp-api}/rabbit/annotation/EnableRabbit.html[the Javadoc of `@EnableRabbit`] for more details.
If you need to create more `RabbitListenerContainerFactory` instances or if you want to override the default, Spring Boot provides a `SimpleRabbitListenerContainerFactoryConfigurer` and a `DirectRabbitListenerContainerFactoryConfigurer` that you can use to initialize a `SimpleRabbitListenerContainerFactory` and a `DirectRabbitListenerContainerFactory` with the same settings as the factories used by the auto-configuration.
@ -5158,7 +5160,7 @@ For example, you might declare the following section in `application.properties`
TIP: To create a topic on startup, add a bean of type `NewTopic`.
If the topic already exists, the bean is ignored.
See {sc-spring-boot-autoconfigure}/kafka/KafkaProperties.{sc-ext}[`KafkaProperties`] for more supported options.
See {spring-boot-autoconfigure-module-code}/kafka/KafkaProperties.java[`KafkaProperties`] for more supported options.
@ -5324,7 +5326,7 @@ spring.kafka.bootstrap-servers=${spring.embedded.kafka.brokers}
[[boot-features-resttemplate]]
== Calling REST Services with `RestTemplate`
If you need to call remote REST services from your application, you can use the Spring Framework's {spring-javadoc}/web/client/RestTemplate.html[`RestTemplate`] class.
If you need to call remote REST services from your application, you can use the Spring Framework's {spring-framework-api}/web/client/RestTemplate.html[`RestTemplate`] class.
Since `RestTemplate` instances often need to be customized before being used, Spring Boot does not provide any single auto-configured `RestTemplate` bean.
It does, however, auto-configure a `RestTemplateBuilder`, which can be used to create `RestTemplate` instances when needed.
The auto-configured `RestTemplateBuilder` ensures that sensible `HttpMessageConverters` are applied to `RestTemplate` instances.
@ -5380,7 +5382,7 @@ Doing so switches off the auto-configuration of a `RestTemplateBuilder` and prev
== Calling REST Services with `WebClient`
If you have Spring WebFlux on your classpath, you can also choose to use `WebClient` to call remote REST services.
Compared to `RestTemplate`, this client has a more functional feel and is fully reactive.
You can learn more about the `WebClient` in the dedicated {spring-reference}web-reactive.html#webflux-client[section in the Spring Framework docs].
You can learn more about the `WebClient` in the dedicated {spring-framework-docs}web-reactive.html#webflux-client[section in the Spring Framework docs].
Spring Boot creates and pre-configures a `WebClient.Builder` for you; it is strongly advised to inject it in your components and use it to create `WebClient` instances.
Spring Boot is configuring that builder to share HTTP resources, reflect codecs setup in the same fashion as the server ones (see <<boot-features-webflux-httpcodecs,WebFlux HTTP codecs auto-configuration>>), and more.
@ -5421,7 +5423,7 @@ Developers can override the resource configuration for Jetty and Reactor Netty b
If you wish to override that choice for the client, you can define your own `ClientHttpConnector` bean and have full control over the client configuration.
You can learn more about the {spring-reference}web-reactive.html#webflux-client-builder[`WebClient` configuration options in the Spring Framework reference documentation].
You can learn more about the {spring-framework-docs}web-reactive.html#webflux-client-builder[`WebClient` configuration options in the Spring Framework reference documentation].
@ -5468,11 +5470,11 @@ For instance, the following service triggers the validation of the first argumen
== Sending Email
The Spring Framework provides an easy abstraction for sending email by using the `JavaMailSender` interface, and Spring Boot provides auto-configuration for it as well as a starter module.
TIP: See the {spring-reference}integration.html#mail[reference documentation] for a detailed explanation of how you can use `JavaMailSender`.
TIP: See the {spring-framework-docs}integration.html#mail[reference documentation] for a detailed explanation of how you can use `JavaMailSender`.
If `spring.mail.host` and the relevant libraries (as defined by `spring-boot-starter-mail`) are available, a default `JavaMailSender` is created if none exists.
The sender can be further customized by configuration items from the `spring.mail` namespace.
See {sc-spring-boot-autoconfigure}/mail/MailProperties.{sc-ext}[`MailProperties`] for more details.
See {spring-boot-autoconfigure-module-code}/mail/MailProperties.java[`MailProperties`] for more details.
In particular, certain default timeout values are infinite, and you may want to change that to avoid having a thread blocked by an unresponsive mail server, as shown in the following example:
@ -5515,7 +5517,7 @@ Spring Boot auto-configures Atomikos and ensures that appropriate `depends-on` s
By default, Atomikos transaction logs are written to a `transaction-logs` directory in your application's home directory (the directory in which your application jar file resides).
You can customize the location of this directory by setting a `spring.jta.log-dir` property in your `application.properties` file.
Properties starting with `spring.jta.atomikos.properties` can also be used to customize the Atomikos `UserTransactionServiceImp`.
See the {dc-spring-boot}/jta/atomikos/AtomikosProperties.{dc-ext}[`AtomikosProperties` Javadoc] for complete details.
See the {spring-boot-module-api}/jta/atomikos/AtomikosProperties.html[`AtomikosProperties` Javadoc] for complete details.
NOTE: To ensure that multiple transaction managers can safely coordinate the same resource managers, each Atomikos instance must be configured with a unique ID. By default, this ID is the IP address of the machine on which Atomikos is running.
To ensure uniqueness in production, you should configure the `spring.jta.transaction-manager-id` property with a different value for each instance of your application.
@ -5580,11 +5582,11 @@ The following example shows how to inject `ConnectionFactory` instances:
[[boot-features-jta-supporting-alternative-embedded]]
=== Supporting an Alternative Embedded Transaction Manager
The {sc-spring-boot}/jms/XAConnectionFactoryWrapper.{sc-ext}[`XAConnectionFactoryWrapper`] and {sc-spring-boot}/jdbc/XADataSourceWrapper.{sc-ext}[`XADataSourceWrapper`] interfaces can be used to support alternative embedded transaction managers.
The {spring-boot-module-code}/jms/XAConnectionFactoryWrapper.java[`XAConnectionFactoryWrapper`] and {spring-boot-module-code}/jdbc/XADataSourceWrapper.java[`XADataSourceWrapper`] interfaces can be used to support alternative embedded transaction managers.
The interfaces are responsible for wrapping `XAConnectionFactory` and `XADataSource` beans and exposing them as regular `ConnectionFactory` and `DataSource` beans, which transparently enroll in the distributed transaction.
DataSource and JMS auto-configuration use JTA variants, provided you have a `JtaTransactionManager` bean and appropriate XA wrapper beans registered within your `ApplicationContext`.
The {sc-spring-boot}/jta/bitronix/BitronixXAConnectionFactoryWrapper.{sc-ext}[BitronixXAConnectionFactoryWrapper] and {sc-spring-boot}/jta/bitronix/BitronixXADataSourceWrapper.{sc-ext}[BitronixXADataSourceWrapper] provide good examples of how to write XA wrappers.
The {spring-boot-module-code}/jta/bitronix/BitronixXAConnectionFactoryWrapper.java[BitronixXAConnectionFactoryWrapper] and {spring-boot-module-code}/jta/bitronix/BitronixXADataSourceWrapper.java[BitronixXADataSourceWrapper] provide good examples of how to write XA wrappers.
@ -5739,7 +5741,7 @@ If `spring-integration-jdbc` is available, the default database schema can be cr
spring.integration.jdbc.initialize-schema=always
----
See the {sc-spring-boot-autoconfigure}/integration/IntegrationAutoConfiguration.{sc-ext}[`IntegrationAutoConfiguration`] and {sc-spring-boot-autoconfigure}/integration/IntegrationProperties.{sc-ext}[`IntegrationProperties`] classes for more details.
See the {spring-boot-autoconfigure-module-code}/integration/IntegrationAutoConfiguration.java[`IntegrationAutoConfiguration`] and {spring-boot-autoconfigure-module-code}/integration/IntegrationProperties.java[`IntegrationProperties`] classes for more details.
By default, if a Micrometer `meterRegistry` bean is present, Spring Integration metrics will be managed by Micrometer.
If you wish to use legacy Spring Integration metrics, add a `DefaultMetricsFactory` bean to the application context.
@ -5762,7 +5764,7 @@ When building a reactive web application, the following stores can be auto-confi
* MongoDB
If a single Spring Session module is present on the classpath, Spring Boot uses that store implementation automatically.
If you have more than one implementation, you must choose the {sc-spring-boot-autoconfigure}/session/StoreType.{sc-ext}[`StoreType`] that you wish to use to store the sessions.
If you have more than one implementation, you must choose the {spring-boot-autoconfigure-module-code}/session/StoreType.java[`StoreType`] that you wish to use to store the sessions.
For instance, to use JDBC as the back-end store, you can configure your application as follows:
[source,properties,indent=0]
@ -5794,7 +5796,7 @@ Any of your beans that are annotated with Spring JMX annotations (`@ManagedResou
If your platform provides a standard `MBeanServer`, Spring Boot will use that and default to the VM `MBeanServer` if necessary.
If all that fails, a new `MBeanServer` will be created.
See the {sc-spring-boot-autoconfigure}/jmx/JmxAutoConfiguration.{sc-ext}[`JmxAutoConfiguration`] class for more details.
See the {spring-boot-autoconfigure-module-code}/jmx/JmxAutoConfiguration.java[`JmxAutoConfiguration`] class for more details.
@ -5833,7 +5835,7 @@ If you have migrated your tests to JUnit 5, you should exclude JUnit 4 support,
The `spring-boot-starter-test` "`Starter`" (in the `test` `scope`) contains the following provided libraries:
* https://junit.org/junit5[JUnit 5] (including the vintage engine for backward compatibility with JUnit 4: The de-facto standard for unit testing Java applications.
* {spring-reference}testing.html#integration-testing[Spring Test] & Spring Boot Test: Utilities and integration test support for Spring Boot applications.
* {spring-framework-docs}testing.html#integration-testing[Spring Test] & Spring Boot Test: Utilities and integration test support for Spring Boot applications.
* https://joel-costigliola.github.io/assertj/[AssertJ]: A fluent assertion library.
* https://github.com/hamcrest/JavaHamcrest[Hamcrest]: A library of matcher objects (also known as constraints or predicates).
* https://mockito.github.io[Mockito]: A Java mocking framework.
@ -5857,7 +5859,7 @@ It is useful to be able to perform integration testing without requiring deploym
The Spring Framework includes a dedicated test module for such integration testing.
You can declare a dependency directly to `org.springframework:spring-test` or use the `spring-boot-starter-test` "`Starter`" to pull it in transitively.
If you have not used the `spring-test` module before, you should start by reading the {spring-reference}testing.html#testing[relevant section] of the Spring Framework reference documentation.
If you have not used the `spring-test` module before, you should start by reading the {spring-framework-docs}testing.html#testing[relevant section] of the Spring Framework reference documentation.
@ -5962,7 +5964,7 @@ You can then import that class explicitly where it is required, as shown in the
----
NOTE: If you directly use `@ComponentScan` (that is, not through `@SpringBootApplication`) you need to register the `TypeExcludeFilter` with it.
See {dc-spring-boot}/context/TypeExcludeFilter.{dc-ext}[the Javadoc] for details.
See {spring-boot-module-api}/context/TypeExcludeFilter.html[the Javadoc] for details.
@ -5982,7 +5984,7 @@ include::{code-examples}/test/context/ApplicationArgumentsExampleTests.java[tag=
[[boot-features-testing-spring-boot-applications-testing-with-mock-environment]]
==== Testing with a mock environment
By default, `@SpringBootTest` does not start the server.
If you have web endpoints that you want to test against this mock environment, you can additionally configure {spring-reference}/testing.html#spring-mvc-test-framework[`MockMvc`] as shown in the following example:
If you have web endpoints that you want to test against this mock environment, you can additionally configure {spring-framework-docs}/testing.html#spring-mvc-test-framework[`MockMvc`] as shown in the following example:
[source,java,indent=0]
----
@ -5991,7 +5993,7 @@ include::{code-examples}/test/web/MockMvcExampleTests.java[tag=test-mock-mvc]
TIP: If you want to focus only on the web layer and not start a complete `ApplicationContext`, consider <<boot-features-testing-spring-boot-applications-testing-autoconfigured-mvc-tests,using `@WebMvcTest` instead>>.
Alternatively, you can configure a {spring-reference}testing.html#webtestclient-tests[`WebTestClient`] as shown in the following example:
Alternatively, you can configure a {spring-framework-docs}testing.html#webtestclient-tests[`WebTestClient`] as shown in the following example:
[source,java,indent=0]
----
@ -6006,7 +6008,7 @@ If you need to start a full running server, we recommend that you use random por
If you use `@SpringBootTest(webEnvironment=WebEnvironment.RANDOM_PORT)`, an available port is picked at random each time your test runs.
The `@LocalServerPort` annotation can be used to <<howto-discover-the-http-port-at-runtime,inject the actual port used>> into your test.
For convenience, tests that need to make REST calls to the started server can additionally `@Autowire` a {spring-reference}testing.html#webtestclient-tests[`WebTestClient`], which resolves relative links to the running server and comes with a dedicated API for verifying responses, as shown in the following example:
For convenience, tests that need to make REST calls to the started server can additionally `@Autowire` a {spring-framework-docs}testing.html#webtestclient-tests[`WebTestClient`], which resolves relative links to the running server and comes with a dedicated API for verifying responses, as shown in the following example:
[source,java,indent=0]
----
@ -6096,7 +6098,7 @@ By the time the test is executed, the application context refresh has completed
We recommend using a `@Bean` method to create and configure the mock in this situation.
Additionally, you can use `@SpyBean` to wrap any existing bean with a Mockito `spy`.
See the {dc-spring-boot-test}/mock/mockito/SpyBean.{dc-ext}[Javadoc] for full details.
See the {spring-boot-test-module-api}/mock/mockito/SpyBean.html[Javadoc] for full details.
NOTE: While Spring's test framework caches application contexts between tests and reuses a context for tests sharing the same configuration, the use of `@MockBean` or `@SpyBean` influences the cache key, which will most likely increase the number of contexts.
@ -6300,7 +6302,7 @@ TIP: Sometimes writing Spring MVC tests is not enough; Spring Boot can help you
[[boot-features-testing-spring-boot-applications-testing-autoconfigured-webflux-tests]]
==== Auto-configured Spring WebFlux Tests
To test that {spring-reference}/web-reactive.html[Spring WebFlux] controllers are working as expected, you can use the `@WebFluxTest` annotation.
To test that {spring-framework-docs}/web-reactive.html[Spring WebFlux] controllers are working as expected, you can use the `@WebFluxTest` annotation.
`@WebFluxTest` auto-configures the Spring WebFlux infrastructure and limits scanned beans to `@Controller`, `@ControllerAdvice`, `@JsonComponent`, `Converter`, `GenericConverter`, `WebFilter`, and `WebFluxConfigurer`.
Regular `@Component` beans are not scanned when the `@WebFluxTest` annotation is used.
@ -6310,7 +6312,7 @@ TIP: If you need to register extra components, such as Jackson `Module`, you can
Often, `@WebFluxTest` is limited to a single controller and used in combination with the `@MockBean` annotation to provide mock implementations for required collaborators.
`@WebFluxTest` also auto-configures {spring-reference}testing.html#webtestclient[`WebTestClient`], which offers a powerful way to quickly test WebFlux controllers without needing to start a full HTTP server.
`@WebFluxTest` also auto-configures {spring-framework-docs}testing.html#webtestclient[`WebTestClient`], which offers a powerful way to quickly test WebFlux controllers without needing to start a full HTTP server.
TIP: You can also auto-configure `WebTestClient` in a non-`@WebFluxTest` (such as `@SpringBootTest`) by annotating it with `@AutoConfigureWebTestClient`.
The following example shows a class that uses both `@WebFluxTest` and a `WebTestClient`:
@ -6368,7 +6370,7 @@ Regular `@Component` beans are not loaded into the `ApplicationContext`.
TIP: A list of the auto-configuration settings that are enabled by `@DataJpaTest` can be <<appendix.adoc#test-auto-configuration,found in the appendix>>.
By default, data JPA tests are transactional and roll back at the end of each test.
See the {spring-reference}testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
See the {spring-framework-docs}testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
If that is not what you want, you can disable transaction management for a test or for the whole class as follows:
[source,java,indent=0]
@ -6385,7 +6387,7 @@ If that is not what you want, you can disable transaction management for a test
}
----
Data JPA tests may also inject a {sc-spring-boot-test-autoconfigure}/orm/jpa/TestEntityManager.{sc-ext}[`TestEntityManager`] bean, which provides an alternative to the standard JPA `EntityManager` that is specifically designed for tests.
Data JPA tests may also inject a {spring-boot-test-autoconfigure-module-code}/orm/jpa/TestEntityManager.java[`TestEntityManager`] bean, which provides an alternative to the standard JPA `EntityManager` that is specifically designed for tests.
If you want to use `TestEntityManager` outside of `@DataJpaTest` instances, you can also use the `@AutoConfigureTestEntityManager` annotation.
A `JdbcTemplate` is also available if you need that. The following example shows the `@DataJpaTest` annotation in use:
@ -6441,7 +6443,7 @@ Regular `@Component` beans are not loaded into the `ApplicationContext`.
TIP: A list of the auto-configurations that are enabled by `@JdbcTest` can be <<appendix.adoc#test-auto-configuration,found in the appendix>>.
By default, JDBC tests are transactional and roll back at the end of each test.
See the {spring-reference}testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
See the {spring-framework-docs}testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
If that is not what you want, you can disable transaction management for a test or for the whole class, as follows:
[source,java,indent=0]
@ -6472,7 +6474,7 @@ Regular `@Component` beans are not loaded into the `ApplicationContext`.
TIP: A list of the auto-configurations that are enabled by `@DataJdbcTest` can be <<appendix.adoc#test-auto-configuration,found in the appendix>>.
By default, Data JDBC tests are transactional and roll back at the end of each test.
See the {spring-reference}testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
See the {spring-framework-docs}testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
If that is not what you want, you can disable transaction management for a test or for the whole test class as <<boot-features-testing-spring-boot-applications-testing-autoconfigured-jdbc-test,shown in the JDBC example>>.
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `DataJpaTest`.
@ -6583,7 +6585,7 @@ The following example shows a typical setup for using Neo4J tests in Spring Boot
----
By default, Data Neo4j tests are transactional and roll back at the end of each test.
See the {spring-reference}testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
See the {spring-framework-docs}testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
If that is not what you want, you can disable transaction management for a test or for the whole class, as follows:
[source,java,indent=0]
@ -6709,7 +6711,7 @@ The specific beans that you want to test should be specified by using the `value
[[boot-features-testing-spring-boot-applications-testing-autoconfigured-rest-docs]]
==== Auto-configured Spring REST Docs Tests
You can use the `@AutoConfigureRestDocs` annotation to use {spring-rest-docs}[Spring REST Docs] in your tests with Mock MVC, REST Assured, or WebTestClient.
You can use the `@AutoConfigureRestDocs` annotation to use {spring-restdocs}[Spring REST Docs] in your tests with Mock MVC, REST Assured, or WebTestClient.
It removes the need for the JUnit extension in Spring REST Docs.
`@AutoConfigureRestDocs` can be used to override the default output directory (`target/generated-snippets` if you are using Maven or `build/generated-snippets` if you are using Gradle).
@ -7024,9 +7026,9 @@ include::{test-examples}/web/client/SampleWebClientTests.java[tag=test]
Spring Boot provides WebSockets auto-configuration for embedded Tomcat, Jetty, and Undertow.
If you deploy a war file to a standalone container, Spring Boot assumes that the container is responsible for the configuration of its WebSocket support.
Spring Framework provides {spring-reference}web.html#websocket[rich WebSocket support] for MVC web applications that can be easily accessed through the `spring-boot-starter-websocket` module.
Spring Framework provides {spring-framework-docs}web.html#websocket[rich WebSocket support] for MVC web applications that can be easily accessed through the `spring-boot-starter-websocket` module.
WebSocket support is also available for {spring-reference}web-reactive.html#webflux-websocket[reactive web applications] and requires to include the WebSocket API alongside `spring-boot-starter-webflux`:
WebSocket support is also available for {spring-framework-docs}web-reactive.html#webflux-websocket[reactive web applications] and requires to include the WebSocket API alongside `spring-boot-starter-webflux`:
[source,xml,indent=0,subs="verbatim,quotes,attributes"]
----
@ -7042,7 +7044,7 @@ WebSocket support is also available for {spring-reference}web-reactive.html#webf
== Web Services
Spring Boot provides Web Services auto-configuration so that all you must do is define your `Endpoints`.
The {spring-webservices-reference}[Spring Web Services features] can be easily accessed with the `spring-boot-starter-webservices` module.
The {spring-webservices-docs}[Spring Web Services features] can be easily accessed with the `spring-boot-starter-webservices` module.
`SimpleWsdl11Definition` and `SimpleXsdSchema` beans can be automatically created for your WSDLs and XSDs respectively.
To do so, configure their location, as shown in the following example:
@ -7057,7 +7059,7 @@ To do so, configure their location, as shown in the following example:
[[boot-features-webservices-template]]
=== Calling Web Services with `WebServiceTemplate`
If you need to call remote Web services from your application, you can use the {spring-webservices-reference}#client-web-service-template[`WebServiceTemplate`] class.
If you need to call remote Web services from your application, you can use the {spring-webservices-docs}#client-web-service-template[`WebServiceTemplate`] class.
Since `WebServiceTemplate` instances often need to be customized before being used, Spring Boot does not provide any single auto-configured `WebServiceTemplate` bean.
It does, however, auto-configure a `WebServiceTemplateBuilder`, which can be used to create `WebServiceTemplate` instances when needed.
@ -7115,7 +7117,7 @@ Additional `@Conditional` annotations are used to constrain when the auto-config
Usually, auto-configuration classes use `@ConditionalOnClass` and `@ConditionalOnMissingBean` annotations.
This ensures that auto-configuration applies only when relevant classes are found and when you have not declared your own `@Configuration`.
You can browse the source code of {sc-spring-boot-autoconfigure}[`spring-boot-autoconfigure`] to see the `@Configuration` classes that Spring provides (see the {github-code}/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories[`META-INF/spring.factories`] file).
You can browse the source code of {spring-boot-autoconfigure-module-code}[`spring-boot-autoconfigure`] to see the `@Configuration` classes that Spring provides (see the {spring-boot-code}/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories[`META-INF/spring.factories`] file).
@ -7136,7 +7138,7 @@ Make sure that they are defined in a specific package space and that they are ne
Furthermore, auto-configuration classes should not enable component scanning to find additional components.
Specific ``@Import``s should be used instead.
You can use the {sc-spring-boot-autoconfigure}/AutoConfigureAfter.{sc-ext}[`@AutoConfigureAfter`] or {sc-spring-boot-autoconfigure}/AutoConfigureBefore.{sc-ext}[`@AutoConfigureBefore`] annotations if your configuration needs to be applied in a specific order.
You can use the {spring-boot-autoconfigure-module-code}/AutoConfigureAfter.java[`@AutoConfigureAfter`] or {spring-boot-autoconfigure-module-code}/AutoConfigureBefore.java[`@AutoConfigureBefore`] annotations if your configuration needs to be applied in a specific order.
For example, if you provide web-specific configuration, your class may need to be applied after `WebMvcAutoConfiguration`.
If you want to order certain auto-configurations that should not have any direct knowledge of each other, you can also use `@AutoConfigureOrder`.
@ -7252,7 +7254,7 @@ A reactive web application is any application that uses a `ReactiveWebApplicatio
[[boot-features-spel-conditions]]
==== SpEL Expression Conditions
The `@ConditionalOnExpression` annotation lets configuration be included based on the result of a {spring-reference}core.html#expressions[SpEL expression].
The `@ConditionalOnExpression` annotation lets configuration be included based on the result of a {spring-framework-docs}core.html#expressions[SpEL expression].
@ -7450,10 +7452,10 @@ If a project is created with only your custom starter, Spring Boot's core featur
[[boot-features-kotlin]]
== Kotlin support
https://kotlinlang.org[Kotlin] is a statically-typed language targeting the JVM (and other platforms) which allows writing concise and elegant code while providing {kotlin-documentation}java-interop.html[interoperability] with existing libraries written in Java.
https://kotlinlang.org[Kotlin] is a statically-typed language targeting the JVM (and other platforms) which allows writing concise and elegant code while providing {kotlin-docs}java-interop.html[interoperability] with existing libraries written in Java.
Spring Boot provides Kotlin support by leveraging the support in other Spring projects such as Spring Framework, Spring Data, and Reactor.
See the {spring-reference}languages.html#kotlin[Spring Framework Kotlin support documentation] for more information.
See the {spring-framework-docs}languages.html#kotlin[Spring Framework Kotlin support documentation] for more information.
The easiest way to start with Spring Boot and Kotlin is to follow https://spring.io/guides/tutorials/spring-boot-kotlin/[this comprehensive tutorial].
You can create new Kotlin projects via https://start.spring.io/#!language=kotlin[start.spring.io].
@ -7466,7 +7468,7 @@ Feel free to join the #spring channel of https://slack.kotlinlang.org/[Kotlin Sl
Spring Boot supports Kotlin 1.3.x. To use Kotlin, `org.jetbrains.kotlin:kotlin-stdlib` and `org.jetbrains.kotlin:kotlin-reflect` must be present on the classpath.
The `kotlin-stdlib` variants `kotlin-stdlib-jdk7` and `kotlin-stdlib-jdk8` can also be used.
Since https://discuss.kotlinlang.org/t/classes-final-by-default/166[Kotlin classes are final by default], you are likely to want to configure {kotlin-documentation}compiler-plugins.html#spring-support[kotlin-spring] plugin in order to automatically open Spring-annotated classes so that they can be proxied.
Since https://discuss.kotlinlang.org/t/classes-final-by-default/166[Kotlin classes are final by default], you are likely to want to configure {kotlin-docs}compiler-plugins.html#spring-support[kotlin-spring] plugin in order to automatically open Spring-annotated classes so that they can be proxied.
https://github.com/FasterXML/jackson-module-kotlin[Jackson's Kotlin module] is required for serializing / deserializing JSON data in Kotlin.
It is automatically registered when found on the classpath.
@ -7478,14 +7480,14 @@ TIP: These dependencies and plugins are provided by default if one bootstraps a
[[boot-features-kotlin-null-safety]]
=== Null-safety
One of Kotlin's key features is {kotlin-documentation}null-safety.html[null-safety].
One of Kotlin's key features is {kotlin-docs}null-safety.html[null-safety].
It deals with `null` values at compile time rather than deferring the problem to runtime and encountering a `NullPointerException`.
This helps to eliminate a common source of bugs without paying the cost of wrappers like `Optional`.
Kotlin also allows using functional constructs with nullable values as described in this https://www.baeldung.com/kotlin-null-safety[comprehensive guide to null-safety in Kotlin].
Although Java does not allow one to express null-safety in its type system, Spring Framework, Spring Data, and Reactor now provide null-safety of their API via tooling-friendly annotations.
By default, types from Java APIs used in Kotlin are recognized as {kotlin-documentation}java-interop.html#null-safety-and-platform-types[platform types] for which null-checks are relaxed.
{kotlin-documentation}java-interop.html#jsr-305-support[Kotlin's support for JSR 305 annotations] combined with nullability annotations provide null-safety for the related Spring API in Kotlin.
By default, types from Java APIs used in Kotlin are recognized as {kotlin-docs}java-interop.html#null-safety-and-platform-types[platform types] for which null-checks are relaxed.
{kotlin-docs}java-interop.html#jsr-305-support[Kotlin's support for JSR 305 annotations] combined with nullability annotations provide null-safety for the related Spring API in Kotlin.
The JSR 305 checks can be configured by adding the `-Xjsr305` compiler flag with the following options: `-Xjsr305={strict|warn|ignore}`.
The default behavior is the same as `-Xjsr305=warn`.
@ -7533,7 +7535,7 @@ It also allows customization of the application as shown in the following exampl
[[boot-features-kotlin-api-extensions]]
==== Extensions
Kotlin {kotlin-documentation}extensions.html[extensions] provide the ability to extend existing classes with additional functionality.
Kotlin {kotlin-docs}extensions.html[extensions] provide the ability to extend existing classes with additional functionality.
The Spring Boot Kotlin API makes use of these extensions to add new Kotlin specific conveniences to existing APIs.
`TestRestTemplate` extensions, similar to those provided by Spring Framework for `RestOperations` in Spring Framework, are provided.
@ -7569,7 +7571,7 @@ data class MyService(
)
----
TIP: To generate <<appendix.adoc#configuration-metadata-annotation-processor,your own metadata>> using the annotation processor, {kotlin-documentation}kapt.html[`kapt` should be configured] with the `spring-boot-configuration-processor` dependency.
TIP: To generate <<appendix.adoc#configuration-metadata-annotation-processor,your own metadata>> using the annotation processor, {kotlin-docs}kapt.html[`kapt` should be configured] with the `spring-boot-configuration-processor` dependency.
Note that some features (such as detecting the default value or deperecated items) are not working due to limitations in the model kapt provides.
@ -7582,8 +7584,8 @@ This makes it possible to use `@BeforeClass` and `@AfterClass` annotations on no
JUnit 5 is the default and the vintage engine is provided for backward compatibility with JUnit 4.
If you don't use it, exclude `org.junit.vintange:junit-vintage-engine`.
See the {junit5-documentation}/#dependency-metadata-junit-jupiter-samples[JUnit 5 documentation] for more details.
You also need to {junit5-documentation}/#writing-tests-test-instance-lifecycle-changing-default[switch test instance lifecycle to "per-class"].
See the {junit5-docs}/#dependency-metadata-junit-jupiter-samples[JUnit 5 documentation] for more details.
You also need to {junit5-docs}/#writing-tests-test-instance-lifecycle-changing-default[switch test instance lifecycle to "per-class"].
To mock Kotlin classes, https://mockk.io/[MockK] is recommended.
If you need the `Mockk` equivalent of the Mockito specific <<boot-features-testing-spring-boot-applications-mocking-beans,`@MockBean` and `@SpyBean` annotations>>, you can use https://github.com/Ninja-Squad/springmockk[SpringMockK] which provides similar `@MockkBean` and `@SpykBean` annotations.
@ -7597,7 +7599,7 @@ If you need the `Mockk` equivalent of the Mockito specific <<boot-features-testi
[[boot-features-kotlin-resources-further-reading]]
==== Further reading
* {kotlin-documentation}[Kotlin language reference]
* {kotlin-docs}[Kotlin language reference]
* https://slack.kotlinlang.org/[Kotlin Slack] (with a dedicated #spring channel)
* https://stackoverflow.com/questions/tagged/spring+kotlin[Stackoverflow with `spring` and `kotlin` tags]
* https://try.kotlinlang.org/[Try Kotlin in your browser]
@ -7623,7 +7625,7 @@ If you need the `Mockk` equivalent of the Mockito specific <<boot-features-testi
[[boot-features-whats-next]]
== What to Read Next
If you want to learn more about any of the classes discussed in this section, you can check out the {dc-root}[Spring Boot API documentation] or you can browse the {github-code}[source code directly].
If you want to learn more about any of the classes discussed in this section, you can check out the {spring-boot-api}[Spring Boot API documentation] or you can browse the {spring-boot-code}[source code directly].
If you have specific questions, take a look at the <<howto.adoc#howto, how-to>> section.
If you are comfortable with Spring Boot's core features, you can continue on and read about <<production-ready-features.adoc#production-ready, production-ready features>>.

@ -43,7 +43,7 @@ The parent project provides the following features:
* UTF-8 source encoding.
* A <<using-boot-dependency-management,Dependency Management section>>, inherited from the spring-boot-dependencies pom, that manages the versions of common dependencies.
This dependency management lets you omit <version> tags for those dependencies when used in your own pom.
* An execution of the {spring-boot-maven-plugin-site}/repackage-mojo.html[`repackage` goal] with a `repackage` execution id.
* An execution of the {spring-boot-maven-plugin-docs}/repackage-mojo.html[`repackage` goal] with a `repackage` execution id.
* Sensible https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html[resource filtering].
* Sensible plugin configuration (https://www.mojohaus.org/exec-maven-plugin/[exec plugin], https://github.com/ktoso/maven-git-commit-id-plugin[Git commit ID], and https://maven.apache.org/plugins/maven-shade-plugin/[shade]).
* Sensible resource filtering for `application.properties` and `application.yml` including profile-specific files (for example, `application-dev.properties` and `application-dev.yml`)
@ -80,7 +80,7 @@ For instance, to upgrade to another Spring Data release train, you would add the
</properties>
----
TIP: Check the {github-code}/spring-boot-project/spring-boot-dependencies/pom.xml[`spring-boot-dependencies` pom] for a list of supported properties.
TIP: Check the {spring-boot-code}/spring-boot-project/spring-boot-dependencies/pom.xml[`spring-boot-dependencies` pom] for a list of supported properties.
@ -164,8 +164,8 @@ There is no need to configure it unless you want to change the settings defined
=== Gradle
To learn about using Spring Boot with Gradle, please refer to the documentation for Spring Boot's Gradle plugin:
* Reference ({spring-boot-gradle-plugin}/reference/html[HTML] and {spring-boot-gradle-plugin}/reference/pdf/spring-boot-gradle-plugin-reference.pdf[PDF])
* {spring-boot-gradle-plugin}/api[API]
* Reference ({spring-boot-gradle-plugin-docs}[HTML] and {spring-boot-gradle-plugin-pdfdocs}[PDF])
* {spring-boot-gradle-plugin-api}[API]
@ -269,7 +269,7 @@ Finally, Spring Boot also includes the following starters that can be used if yo
.Spring Boot technical starters
include::{generated-resources-root}/technical-starters.adoc[]
TIP: For a list of additional community contributed starters, see the {github-master-code}/spring-boot-project/spring-boot-starters/README.adoc[README file] in the `spring-boot-starters` module on GitHub.
TIP: For a list of additional community contributed starters, see the {spring-boot-master-code}/spring-boot-project/spring-boot-starters/README.adoc[README file] in the `spring-boot-starters` module on GitHub.
@ -549,7 +549,7 @@ Most IDEs can import Maven projects directly.
For example, Eclipse users can select `Import...` -> `Existing Maven Projects` from the `File` menu.
If you cannot directly import your project into your IDE, you may be able to generate IDE metadata by using a build plugin. Maven includes plugins for https://maven.apache.org/plugins/maven-eclipse-plugin/[Eclipse] and https://maven.apache.org/plugins/maven-idea-plugin/[IDEA].
Gradle offers plugins for {gradle-user-guide}/userguide.html[various IDEs].
Gradle offers plugins for {gradle-docs}/userguide.html[various IDEs].
TIP: If you accidentally run a web application twice, you see a "`Port already in use`" error. STS users can use the `Relaunch` button rather than the `Run` button to ensure that any existing instance is closed.
@ -687,7 +687,7 @@ If you wish to log all request details (including potentially sensitive informat
NOTE: If you don't want property defaults to be applied you can set `spring.devtools.add-properties` to `false` in your `application.properties`.
TIP: For a complete list of the properties that are applied by the devtools, see {sc-spring-boot-devtools}/env/DevToolsPropertyDefaultsPostProcessor.{sc-ext}[DevToolsPropertyDefaultsPostProcessor].
TIP: For a complete list of the properties that are applied by the devtools, see {spring-boot-devtools-module-code}/env/DevToolsPropertyDefaultsPostProcessor.java[DevToolsPropertyDefaultsPostProcessor].
@ -971,7 +971,7 @@ If you change a file before starting the remote client, it is not pushed to the
[[configuring-file-system-watcher]]
==== Configuring File System Watcher
{sc-spring-boot-devtools}/filewatch/FileSystemWatcher.{sc-ext}[FileSystemWatcher] works by polling the class changes with a certain time interval, and then waiting for a predefined quiet period to make sure there are no more changes.
{spring-boot-devtools-module-code}/filewatch/FileSystemWatcher.java[FileSystemWatcher] works by polling the class changes with a certain time interval, and then waiting for a predefined quiet period to make sure there are no more changes.
The changes are then uploaded to the remote application.
On a slower development environment, it may happen that the quiet period is not enough, and the changes in the classes may be split into batches.
The server is restarted after the first batch of class changes is uploaded.

@ -14,8 +14,8 @@ def generateAutoConfigurationClassTable(String module, File factories, PrintWrit
getAutoConfigurationClasses(factories).each {
writer.println ''
writer.println "| {github-code}/spring-boot-project/$module/src/main/java/$it.path.{sc-ext}[`$it.name`]"
writer.println "| {dc-root}/$it.path.{dc-ext}[javadoc]"
writer.println "| {spring-boot-code}/spring-boot-project/${module}/src/main/java/${it.path}.java[`${it.name}`]"
writer.println "| {spring-boot-api}/${it.path}.html[javadoc]"
}
writer.println '|==='

@ -11,7 +11,7 @@ def getStarters(File dir) {
'name': name,
'description': postProcessDescription(pom.description.text()),
'dependencies': dependencies,
'pomUrl': "{github-code}/spring-boot-project/spring-boot-starters/$name/pom.xml"
'pomUrl': "{spring-boot-code}/spring-boot-project/spring-boot-starters/$name/pom.xml"
]
}
}

Loading…
Cancel
Save