diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle
index 2ecfb58208..4bb899895b 100644
--- a/spring-boot-project/spring-boot-docs/build.gradle
+++ b/spring-boot-project/spring-boot-docs/build.gradle
@@ -181,33 +181,33 @@ task aggregatedJavadoc(type: Javadoc) {
task documentTestSlices(type: org.springframework.boot.build.test.autoconfigure.DocumentTestSlices) {
testSlices = configurations.testSlices
- outputFile = file("${buildDir}/docs/generated/test-slice-auto-configuration.adoc")
+ outputFile = file("${buildDir}/docs/generated/test-auto-configuration/documented-slices.adoc")
}
task documentStarters(type: org.springframework.boot.build.starters.DocumentStarters) {
- outputDir = file("${buildDir}/docs/generated/starters/")
+ outputDir = file("${buildDir}/docs/generated/using/starters/")
}
task documentAutoConfigurationClasses(type: org.springframework.boot.build.autoconfigure.DocumentAutoConfigurationClasses) {
autoConfiguration = configurations.autoConfiguration
- outputDir = file("${buildDir}/docs/generated/auto-configuration-classes/")
+ outputDir = file("${buildDir}/docs/generated/auto-configuration-classes/documented-auto-configuration-classes/")
}
task documentDependencyVersions(type: org.springframework.boot.build.constraints.DocumentConstrainedVersions) {
dependsOn dependencyVersions
constrainedVersions.set(providers.provider { dependencyVersions.constrainedVersions })
- outputFile = file("${buildDir}/docs/generated/generated-dependency-versions.adoc")
+ outputFile = file("${buildDir}/docs/generated/dependency-versions/documented-coordinates.adoc")
}
task documentVersionProperties(type: org.springframework.boot.build.constraints.DocumentVersionProperties) {
dependsOn dependencyVersions
versionProperties.set(providers.provider { dependencyVersions.versionProperties})
- outputFile = file("${buildDir}/docs/generated/generated-version-properties.adoc")
+ outputFile = file("${buildDir}/docs/generated/dependency-versions/documented-properties.adoc")
}
task documentConfigurationProperties(type: org.springframework.boot.build.context.properties.DocumentConfigurationProperties) {
configurationPropertyMetadata = configurations.configurationProperties
- outputDir = file("${buildDir}/docs/generated/config-docs/")
+ outputDir = file("${buildDir}/docs/generated/application-properties/documented-application-properties/")
}
tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) {
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator.adoc
index 3ec946013a..f9e97e30b2 100644
--- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator.adoc
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator.adoc
@@ -2,2868 +2,32 @@
= Spring Boot Actuator: Production-ready Features
include::attributes.adoc[]
+
+
Spring Boot includes a number of additional features to help you monitor and manage your application when you push it to production.
You can choose to manage and monitor your application by using HTTP endpoints or with JMX.
Auditing, health, and metrics gathering can also be automatically applied to your application.
-[[actuator.enabling]]
-== Enabling 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 recommended way to enable the features is to add a dependency on the `spring-boot-starter-actuator` '`Starter`'.
+include::actuator/enabling.adoc[]
-.Definition of Actuator
-****
-An actuator is a manufacturing term that refers to a mechanical device for moving or controlling something.
-Actuators can generate a large amount of motion from a small change.
-****
+include::actuator/endpoints.adoc[]
-To add the actuator to a Maven based project, add the following '`Starter`' dependency:
+include::actuator/monitoring.adoc[]
-[source,xml,indent=0]
-----
-
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-
-----
+include::actuator/jmx.adoc[]
-For Gradle, use the following declaration:
+include::actuator/loggers.adoc[]
-[source,groovy,indent=0]
-----
- dependencies {
- implementation 'org.springframework.boot:spring-boot-starter-actuator'
- }
-----
+include::actuator/metrics.adoc[]
+include::actuator/auditing.adoc[]
+include::actuator/tracing.adoc[]
-[[actuator.endpoints]]
-== Endpoints
-Actuator endpoints let you monitor and interact with your application.
-Spring Boot includes a number of built-in endpoints and lets you add your own.
-For example, the `health` endpoint provides basic application health information.
+include::actuator/process-monitoring.adoc[]
-Each individual endpoint can be <> and <>.
-An endpoint is considered to be available when it is both enabled and exposed.
-The built-in endpoints will only be auto-configured when they are available.
-Most applications choose exposure via HTTP, where the ID of the endpoint along with a prefix of `/actuator` is mapped to a URL.
-For example, by default, the `health` endpoint is mapped to `/actuator/health`.
+include::actuator/cloud-foundry.adoc[]
-TIP: 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-docs}[HTML] or {spring-boot-actuator-restapi-pdfdocs}[PDF]).
-
-The following technology-agnostic endpoints are available:
-
-[cols="2,5"]
-|===
-| ID | Description
-
-| `auditevents`
-| Exposes audit events information for the current application.
- Requires an `AuditEventRepository` bean.
-
-| `beans`
-| Displays a complete list of all the Spring beans in your application.
-
-| `caches`
-| Exposes available caches.
-
-| `conditions`
-| Shows the conditions that were evaluated on configuration and auto-configuration classes and the reasons why they did or did not match.
-
-| `configprops`
-| Displays a collated list of all `@ConfigurationProperties`.
-
-| `env`
-| Exposes properties from Spring's `ConfigurableEnvironment`.
-
-| `flyway`
-| Shows any Flyway database migrations that have been applied.
- Requires one or more `Flyway` beans.
-
-| `health`
-| Shows application health information.
-
-| `httptrace`
-| Displays HTTP trace information (by default, the last 100 HTTP request-response exchanges).
- Requires an `HttpTraceRepository` bean.
-
-| `info`
-| Displays arbitrary application info.
-
-| `integrationgraph`
-| Shows the Spring Integration graph.
- Requires a dependency on `spring-integration-core`.
-
-| `loggers`
-| Shows and modifies the configuration of loggers in the application.
-
-| `liquibase`
-| Shows any Liquibase database migrations that have been applied.
- Requires one or more `Liquibase` beans.
-
-| `metrics`
-| Shows '`metrics`' information for the current application.
-
-| `mappings`
-| Displays a collated list of all `@RequestMapping` paths.
-
-|`quartz`
-|Shows information about Quartz Scheduler jobs.
-
-| `scheduledtasks`
-| Displays the scheduled tasks in your application.
-
-| `sessions`
-| Allows retrieval and deletion of user sessions from a Spring Session-backed session store.
- Requires a Servlet-based web application using Spring Session.
-
-| `shutdown`
-| Lets the application be gracefully shutdown.
- Disabled by default.
-
-| `startup`
-| Shows the <> collected by the `ApplicationStartup`.
- Requires the `SpringApplication` to be configured with a `BufferingApplicationStartup`.
-
-| `threaddump`
-| Performs a thread dump.
-|===
-
-If your application is a web application (Spring MVC, Spring WebFlux, or Jersey), you can use the following additional endpoints:
-
-[cols="2,5"]
-|===
-| ID | Description
-
-| `heapdump`
-| Returns an `hprof` heap dump file.
-
-| `jolokia`
-| Exposes JMX beans over HTTP (when Jolokia is on the classpath, not available for WebFlux).
- Requires a dependency on `jolokia-core`.
-
-| `logfile`
-| Returns the contents of the logfile (if `logging.file.name` or `logging.file.path` properties have been set).
- Supports the use of the HTTP `Range` header to retrieve part of the log file's content.
-
-| `prometheus`
-| Exposes metrics in a format that can be scraped by a Prometheus server.
- Requires a dependency on `micrometer-registry-prometheus`.
-|===
-
-
-
-[[actuator.endpoints.enabling]]
-=== Enabling Endpoints
-By default, all endpoints except for `shutdown` are enabled.
-To configure the enablement of an endpoint, use its `management.endpoint..enabled` property.
-The following example enables the `shutdown` endpoint:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoint:
- shutdown:
- enabled: true
-----
-
-If you prefer endpoint enablement to be opt-in rather than opt-out, set the configprop:management.endpoints.enabled-by-default[] property to `false` and use individual endpoint `enabled` properties to opt back in.
-The following example enables the `info` endpoint and disables all other endpoints:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoints:
- enabled-by-default: false
- endpoint:
- info:
- enabled: true
-----
-
-NOTE: Disabled endpoints are removed entirely from the application context.
-If you want to change only the technologies over which an endpoint is exposed, use the <> instead.
-
-
-
-[[actuator.endpoints.exposing]]
-=== Exposing Endpoints
-Since Endpoints may contain sensitive information, careful consideration should be given about when to expose them.
-The following table shows the default exposure for the built-in endpoints:
-
-[cols="1,1,1"]
-|===
-| ID | JMX | Web
-
-| `auditevents`
-| Yes
-| No
-
-| `beans`
-| Yes
-| No
-
-| `caches`
-| Yes
-| No
-
-| `conditions`
-| Yes
-| No
-
-| `configprops`
-| Yes
-| No
-
-| `env`
-| Yes
-| No
-
-| `flyway`
-| Yes
-| No
-
-| `health`
-| Yes
-| Yes
-
-| `heapdump`
-| N/A
-| No
-
-| `httptrace`
-| Yes
-| No
-
-| `info`
-| Yes
-| Yes
-
-| `integrationgraph`
-| Yes
-| No
-
-| `jolokia`
-| N/A
-| No
-
-| `logfile`
-| N/A
-| No
-
-| `loggers`
-| Yes
-| No
-
-| `liquibase`
-| Yes
-| No
-
-| `metrics`
-| Yes
-| No
-
-| `mappings`
-| Yes
-| No
-
-| `prometheus`
-| N/A
-| No
-
-| `quartz`
-| Yes
-| No
-
-| `scheduledtasks`
-| Yes
-| No
-
-| `sessions`
-| Yes
-| No
-
-| `shutdown`
-| Yes
-| No
-
-| `startup`
-| Yes
-| No
-
-| `threaddump`
-| Yes
-| No
-|===
-
-To change which endpoints are exposed, use the following technology-specific `include` and `exclude` properties:
-
-[cols="3,1"]
-|===
-| Property | Default
-
-| configprop:management.endpoints.jmx.exposure.exclude[]
-|
-
-| configprop:management.endpoints.jmx.exposure.include[]
-| `*`
-
-| configprop:management.endpoints.web.exposure.exclude[]
-|
-
-| configprop:management.endpoints.web.exposure.include[]
-| `info, health`
-|===
-
-The `include` property lists the IDs of the endpoints that are exposed.
-The `exclude` property lists the IDs of the endpoints that should not be exposed.
-The `exclude` property takes precedence over the `include` property.
-Both `include` and `exclude` properties can be configured with a list of endpoint IDs.
-
-For example, to stop exposing all endpoints over JMX and only expose the `health` and `info` endpoints, use the following property:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoints:
- jmx:
- exposure:
- include: "health,info"
-----
-
-`*` can be used to select all endpoints.
-For example, to expose everything over HTTP except the `env` and `beans` endpoints, use the following properties:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoints:
- web:
- exposure:
- include: "*"
- exclude: "env,beans"
-----
-
-NOTE: `*` has a special meaning in YAML, so be sure to add quotes if you want to include (or exclude) all endpoints.
-
-NOTE: If your application is exposed publicly, we strongly recommend that you also <>.
-
-TIP: If you want to implement your own strategy for when endpoints are exposed, you can register an `EndpointFilter` bean.
-
-
-
-[[actuator.endpoints.security]]
-=== Securing HTTP Endpoints
-You should take care to secure HTTP endpoints in the same way that you would any other sensitive URL.
-If Spring Security is present, endpoints are secured by default using Spring Security’s content-negotiation strategy.
-If you wish to configure custom security for HTTP endpoints, for example, only allow users with a certain role to access them, Spring Boot provides some convenient `RequestMatcher` objects that can be used in combination with Spring Security.
-
-A typical Spring Security configuration might look something like the following example:
-
-[source,java,pending-extract=true,indent=0]
-----
- @Bean
- public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
- http.requestMatcher(EndpointRequest.toAnyEndpoint()).authorizeRequests((requests) ->
- requests.anyRequest().hasRole("ENDPOINT_ADMIN"));
- http.httpBasic();
- return http.build();
- }
-----
-
-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-restapi-docs}[HTML] or {spring-boot-actuator-restapi-pdfdocs}[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 configprop:management.endpoints.web.exposure.include[] property, as follows:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoints:
- web:
- exposure:
- include: "*"
-----
-
-Additionally, if Spring Security is present, you would need to add custom security configuration that allows unauthenticated access to the endpoints as shown in the following example:
-
-[source,java,pending-extract=true,indent=0]
-----
- @Bean
- public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
- http.requestMatcher(EndpointRequest.toAnyEndpoint()).authorizeRequests((requests) ->
- requests.anyRequest().permitAll());
- return http.build();
- }
-----
-
-NOTE: In both the examples above, the configuration applies only to the actuator endpoints.
-Since Spring Boot's security configuration backs off completely in the presence of any `SecurityFilterChain` bean, you will need to configure an additional `SecurityFilterChain` bean with rules that apply to the rest of the application.
-
-
-
-[[actuator.endpoints.caching]]
-=== Configuring Endpoints
-Endpoints automatically cache responses to read operations that do not take any parameters.
-To configure the amount of time for which an endpoint will cache a response, use its `cache.time-to-live` property.
-The following example sets the time-to-live of the `beans` endpoint's cache to 10 seconds:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoint:
- beans:
- cache:
- time-to-live: "10s"
-----
-
-NOTE: The prefix `management.endpoint.` is used to uniquely identify the endpoint that is being configured.
-
-
-
-[[actuator.endpoints.hypermedia]]
-=== Hypermedia for Actuator Web Endpoints
-A "`discovery page`" is added with links to all the endpoints.
-The "`discovery page`" is available on `/actuator` by default.
-
-To disable the "`discovery page`", add the following property to your application properties:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoints:
- web:
- discovery:
- enabled: false
-----
-
-When a custom management context path is configured, the "`discovery page`" automatically moves from `/actuator` to the root of the management context.
-For example, if the management context path is `/management`, then the discovery page is available from `/management`.
-When the management context path is set to `/`, the discovery page is disabled to prevent the possibility of a clash with other mappings.
-
-
-
-[[actuator.endpoints.cors]]
-=== 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] that lets you specify in a flexible way what kind of cross-domain requests are authorized.
-If you use Spring MVC or Spring WebFlux, Actuator's web endpoints can be configured to support such scenarios.
-
-CORS support is disabled by default and is only enabled once the configprop:management.endpoints.web.cors.allowed-origins[] property has been set.
-The following configuration permits `GET` and `POST` calls from the `example.com` domain:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoints:
- web:
- cors:
- allowed-origins: "https://example.com"
- allowed-methods: "GET,POST"
-----
-
-TIP: See {spring-boot-actuator-autoconfigure-module-code}/endpoint/web/CorsEndpointProperties.java[CorsEndpointProperties] for a complete list of options.
-
-
-
-[[actuator.endpoints.implementing-custom]]
-=== Implementing Custom Endpoints
-If you add a `@Bean` annotated with `@Endpoint`, any methods annotated with `@ReadOperation`, `@WriteOperation`, or `@DeleteOperation` are automatically exposed over JMX and, in a web application, over HTTP as well.
-Endpoints can be exposed over HTTP using Jersey, Spring MVC, or Spring WebFlux.
-If both Jersey and Spring MVC are available, Spring MVC will be used.
-
-The following example exposes a read operation that returns a custom object:
-
-[source,java,indent=0]
-----
-include::{include-productionreadyfeatures}/endpoints/CustomEndpoint.java[tag=read]
-----
-
-You can also write technology-specific endpoints by using `@JmxEndpoint` or `@WebEndpoint`.
-These endpoints are restricted to their respective technologies.
-For example, `@WebEndpoint` is exposed only over HTTP and not over JMX.
-
-You can write technology-specific extensions by using `@EndpointWebExtension` and `@EndpointJmxExtension`.
-These annotations let you provide technology-specific operations to augment an existing endpoint.
-
-Finally, if you need access to web-framework-specific functionality, you can implement Servlet or Spring `@Controller` and `@RestController` endpoints at the cost of them not being available over JMX or when using a different web framework.
-
-
-
-[[actuator.endpoints.implementing-custom.input]]
-==== Receiving Input
-Operations on an endpoint receive input via their parameters.
-When exposed via the web, the values for these parameters are taken from the URL's query parameters and from the JSON request body.
-When exposed via JMX, the parameters are mapped to the parameters of the MBean's operations.
-Parameters are required by default.
-They can be made optional by annotating them with either `@javax.annotation.Nullable` or `@org.springframework.lang.Nullable`.
-
-Each root property in the JSON request body can be mapped to a parameter of the endpoint.
-Consider the following JSON request body:
-
-[source,json,indent=0]
-----
- {
- "name": "test",
- "counter": 42
- }
-----
-
-This can be used to invoke a write operation that takes `String name` and `int counter` parameters, as shown in the following example:
-
-[source,java,indent=0]
-----
-include::{include-productionreadyfeatures}/endpoints/CustomEndpoint.java[tag=write]
-----
-
-TIP: Because endpoints are technology agnostic, only simple types can be specified in the method signature.
-In particular declaring a single parameter with a `CustomData` type defining a `name` and `counter` properties is not supported.
-
-NOTE: To allow the input to be mapped to the operation method's parameters, Java code implementing an endpoint should be compiled with `-parameters`, and Kotlin code implementing an endpoint should be compiled with `-java-parameters`.
-This will happen automatically if you are using Spring Boot's Gradle plugin or if you are using Maven and `spring-boot-starter-parent`.
-
-
-
-[[actuator.endpoints.implementing-custom.input.conversion]]
-===== Input Type Conversion
-The parameters passed to endpoint operation methods are, if necessary, automatically converted to the required type.
-Before calling an operation method, the input received via JMX or an HTTP request is converted to the required types using an instance of `ApplicationConversionService` as well as any `Converter` or `GenericConverter` beans qualified with `@EndpointConverter`.
-
-
-
-[[actuator.endpoints.implementing-custom.web]]
-==== Custom Web Endpoints
-Operations on an `@Endpoint`, `@WebEndpoint`, or `@EndpointWebExtension` are automatically exposed over HTTP using Jersey, Spring MVC, or Spring WebFlux.
-If both Jersey and Spring MVC are available, Spring MVC will be used.
-
-
-
-[[actuator.endpoints.implementing-custom.web.request-predicates]]
-===== Web Endpoint Request Predicates
-A request predicate is automatically generated for each operation on a web-exposed endpoint.
-
-
-
-[[actuator.endpoints.implementing-custom.web.path-predicates]]
-===== Path
-The path of the predicate is determined by the ID of the endpoint and the base path of web-exposed endpoints.
-The default base path is `/actuator`.
-For example, an endpoint with the ID `sessions` will use `/actuator/sessions` as its path in the predicate.
-
-The path can be further customized by annotating one or more parameters of the operation method with `@Selector`.
-Such a parameter is added to the path predicate as a path variable.
-The variable's value is passed into the operation method when the endpoint operation is invoked.
-If you want to capture all remaining path elements, you can add `@Selector(Match=ALL_REMAINING)` to the last parameter and make it a type that is conversion compatible with a `String[]`.
-
-
-
-[[actuator.endpoints.implementing-custom.web.method-predicates]]
-===== HTTP method
-The HTTP method of the predicate is determined by the operation type, as shown in the following table:
-
-[cols="3, 1"]
-|===
-| Operation | HTTP method
-
-| `@ReadOperation`
-| `GET`
-
-| `@WriteOperation`
-| `POST`
-
-| `@DeleteOperation`
-| `DELETE`
-|===
-
-
-
-[[actuator.endpoints.implementing-custom.web.consumes-predicates]]
-===== Consumes
-For a `@WriteOperation` (HTTP `POST`) that uses the request body, the consumes clause of the predicate is `application/vnd.spring-boot.actuator.v2+json, application/json`.
-For all other operations the consumes clause is empty.
-
-
-
-[[actuator.endpoints.implementing-custom.web.produces-predicates]]
-===== Produces
-The produces clause of the predicate can be determined by the `produces` attribute of the `@DeleteOperation`, `@ReadOperation`, and `@WriteOperation` annotations.
-The attribute is optional.
-If it is not used, the produces clause is determined automatically.
-
-If the operation method returns `void` or `Void` the produces clause is empty.
-If the operation method returns a `org.springframework.core.io.Resource`, the produces clause is `application/octet-stream`.
-For all other operations the produces clause is `application/vnd.spring-boot.actuator.v2+json, application/json`.
-
-
-
-[[actuator.endpoints.implementing-custom.web.response-status]]
-===== Web Endpoint Response Status
-The default response status for an endpoint operation depends on the operation type (read, write, or delete) and what, if anything, the operation returns.
-
-A `@ReadOperation` returns a value, the response status will be 200 (OK).
-If it does not return a value, the response status will be 404 (Not Found).
-
-If a `@WriteOperation` or `@DeleteOperation` returns a value, the response status will be 200 (OK).
-If it does not return a value the response status will be 204 (No Content).
-
-If an operation is invoked without a required parameter, or with a parameter that cannot be converted to the required type, the operation method will not be called and the response status will be 400 (Bad Request).
-
-
-
-[[actuator.endpoints.implementing-custom.web.range-requests]]
-===== Web Endpoint Range Requests
-An HTTP range request can be used to request part of an HTTP resource.
-When using Spring MVC or Spring Web Flux, operations that return a `org.springframework.core.io.Resource` automatically support range requests.
-
-NOTE: Range requests are not supported when using Jersey.
-
-
-
-[[actuator.endpoints.implementing-custom.web.security]]
-===== Web Endpoint Security
-An operation on a web endpoint or a web-specific endpoint extension can receive the current `java.security.Principal` or `org.springframework.boot.actuate.endpoint.SecurityContext` as a method parameter.
-The former is typically used in conjunction with `@Nullable` to provide different behavior for authenticated and unauthenticated users.
-The latter is typically used to perform authorization checks using its `isUserInRole(String)` method.
-
-
-
-[[actuator.endpoints.implementing-custom.servlet]]
-==== Servlet Endpoints
-A `Servlet` can be exposed as an endpoint by implementing a class annotated with `@ServletEndpoint` that also implements `Supplier`.
-Servlet endpoints provide deeper integration with the Servlet container but at the expense of portability.
-They are intended to be used to expose an existing `Servlet` as an endpoint.
-For new endpoints, the `@Endpoint` and `@WebEndpoint` annotations should be preferred whenever possible.
-
-
-
-[[actuator.endpoints.implementing-custom.controller]]
-==== Controller Endpoints
-`@ControllerEndpoint` and `@RestControllerEndpoint` can be used to implement an endpoint that is only exposed by Spring MVC or Spring WebFlux.
-Methods are mapped using the standard annotations for Spring MVC and Spring WebFlux such as `@RequestMapping` and `@GetMapping`, with the endpoint's ID being used as a prefix for the path.
-Controller endpoints provide deeper integration with Spring's web frameworks but at the expense of portability.
-The `@Endpoint` and `@WebEndpoint` annotations should be preferred whenever possible.
-
-
-
-[[actuator.endpoints.health]]
-=== Health Information
-You can use health information to check the status of your running application.
-It is often used by monitoring software to alert someone when a production system goes down.
-The information exposed by the `health` endpoint depends on the configprop:management.endpoint.health.show-details[] and configprop:management.endpoint.health.show-components[] properties which can be configured with one of the following values:
-
-[cols="1, 3"]
-|===
-| Name | Description
-
-| `never`
-| Details are never shown.
-
-| `when-authorized`
-| Details are only shown to authorized users.
- Authorized roles can be configured using `management.endpoint.health.roles`.
-
-| `always`
-| Details are shown to all users.
-|===
-
-The default value is `never`.
-A user is considered to be authorized when they are in one or more of the endpoint's roles.
-If the endpoint has no configured roles (the default) all authenticated users are considered to be authorized.
-The roles can be configured using the configprop:management.endpoint.health.roles[] property.
-
-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 {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`.
-A `HealthIndicator` provides actual health information, including a `Status`.
-A `CompositeHealthContributor` provides a composite of other `HealthContributors`.
-Taken together, contributors form a tree structure to represent the overall system health.
-
-By default, the final system health is derived by a `StatusAggregator` which sorts the statuses from each `HealthIndicator` based on an ordered list of statuses.
-The first status in the sorted list is used as the overall health status.
-If no `HealthIndicator` returns a status that is known to the `StatusAggregator`, an `UNKNOWN` status is used.
-
-TIP: The `HealthContributorRegistry` can be used to register and unregister health indicators at runtime.
-
-
-
-[[actuator.endpoints.health.auto-configured-health-indicators]]
-==== Auto-configured HealthIndicators
-The following `HealthIndicators` are auto-configured by Spring Boot when appropriate.
-You can also enable/disable selected indicators by configuring `management.health.key.enabled`,
-with the `key` listed in the table below.
-
-[cols="2,4,6"]
-|===
-| Key | Name | Description
-
-| `cassandra`
-| {spring-boot-actuator-module-code}/cassandra/CassandraDriverHealthIndicator.java[`CassandraDriverHealthIndicator`]
-| Checks that a Cassandra database is up.
-
-| `couchbase`
-| {spring-boot-actuator-module-code}/couchbase/CouchbaseHealthIndicator.java[`CouchbaseHealthIndicator`]
-| Checks that a Couchbase cluster is up.
-
-| `db`
-| {spring-boot-actuator-module-code}/jdbc/DataSourceHealthIndicator.java[`DataSourceHealthIndicator`]
-| Checks that a connection to `DataSource` can be obtained.
-
-| `diskspace`
-| {spring-boot-actuator-module-code}/system/DiskSpaceHealthIndicator.java[`DiskSpaceHealthIndicator`]
-| Checks for low disk space.
-
-| `elasticsearch`
-| {spring-boot-actuator-module-code}/elasticsearch/ElasticsearchRestHealthIndicator.java[`ElasticsearchRestHealthIndicator`]
-| Checks that an Elasticsearch cluster is up.
-
-| `hazelcast`
-| {spring-boot-actuator-module-code}/hazelcast/HazelcastHealthIndicator.java[`HazelcastHealthIndicator`]
-| Checks that a Hazelcast server is up.
-
-| `influxdb`
-| {spring-boot-actuator-module-code}/influx/InfluxDbHealthIndicator.java[`InfluxDbHealthIndicator`]
-| Checks that an InfluxDB server is up.
-
-| `jms`
-| {spring-boot-actuator-module-code}/jms/JmsHealthIndicator.java[`JmsHealthIndicator`]
-| Checks that a JMS broker is up.
-
-| `ldap`
-| {spring-boot-actuator-module-code}/ldap/LdapHealthIndicator.java[`LdapHealthIndicator`]
-| Checks that an LDAP server is up.
-
-| `mail`
-| {spring-boot-actuator-module-code}/mail/MailHealthIndicator.java[`MailHealthIndicator`]
-| Checks that a mail server is up.
-
-| `mongo`
-| {spring-boot-actuator-module-code}/mongo/MongoHealthIndicator.java[`MongoHealthIndicator`]
-| Checks that a Mongo database is up.
-
-| `neo4j`
-| {spring-boot-actuator-module-code}/neo4j/Neo4jHealthIndicator.java[`Neo4jHealthIndicator`]
-| Checks that a Neo4j database is up.
-
-| `ping`
-| {spring-boot-actuator-module-code}/health/PingHealthIndicator.java[`PingHealthIndicator`]
-| Always responds with `UP`.
-
-| `rabbit`
-| {spring-boot-actuator-module-code}/amqp/RabbitHealthIndicator.java[`RabbitHealthIndicator`]
-| Checks that a Rabbit server is up.
-
-| `redis`
-| {spring-boot-actuator-module-code}/redis/RedisHealthIndicator.java[`RedisHealthIndicator`]
-| Checks that a Redis server is up.
-
-| `solr`
-| {spring-boot-actuator-module-code}/solr/SolrHealthIndicator.java[`SolrHealthIndicator`]
-| Checks that a Solr server is up.
-|===
-
-TIP: You can disable them all by setting the configprop:management.health.defaults.enabled[] property.
-
-Additional `HealthIndicators` are available but not enabled by default:
-
-[cols="3,4,6"]
-|===
-| Key | Name | Description
-
-| `livenessstate`
-| {spring-boot-actuator-module-code}/availability/LivenessStateHealthIndicator.java[`LivenessStateHealthIndicator`]
-| Exposes the "Liveness" application availability state.
-
-| `readinessstate`
-| {spring-boot-actuator-module-code}/availability/ReadinessStateHealthIndicator.java[`ReadinessStateHealthIndicator`]
-| Exposes the "Readiness" application availability state.
-|===
-
-
-
-[[actuator.endpoints.health.writing-custom-health-indicators]]
-==== Writing Custom HealthIndicators
-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:
-
-[source,java,pending-extract=true,indent=0]
-----
- import org.springframework.boot.actuate.health.Health;
- import org.springframework.boot.actuate.health.HealthIndicator;
- import org.springframework.stereotype.Component;
-
- @Component
- public class MyHealthIndicator implements HealthIndicator {
-
- @Override
- public Health health() {
- int errorCode = check(); // perform some specific health check
- if (errorCode != 0) {
- return Health.down().withDetail("Error Code", errorCode).build();
- }
- return Health.up().build();
- }
-
- }
-----
-
-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 {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 configprop: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:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoint:
- health:
- status:
- order: "fatal,down,out-of-service,unknown,up"
-----
-
-The HTTP status code in the response reflects the overall health status.
-By default, `OUT_OF_SERVICE` and `DOWN` map to 503.
-Any unmapped health statuses, including `UP`, map to 200.
-You might also want to register custom status mappings if you access the health endpoint over HTTP.
-Configuring a custom mapping disables the defaults mappings for `DOWN` and `OUT_OF_SERVICE`.
-If you want to retain the default mappings they must be configured explicitly alongside any custom mappings.
-For example, the following property maps `FATAL` to 503 (service unavailable) and retains the default mappings for `DOWN` and `OUT_OF_SERVICE`:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoint:
- health:
- status:
- http-mapping:
- down: 503
- fatal: 503
- out-of-service: 503
-----
-
-TIP: If you need more control, you can define your own `HttpCodeStatusMapper` bean.
-
-The following table shows the default status mappings for the built-in statuses:
-
-[cols="1,3"]
-|===
-| Status | Mapping
-
-| DOWN
-| SERVICE_UNAVAILABLE (503)
-
-| OUT_OF_SERVICE
-| SERVICE_UNAVAILABLE (503)
-
-| UP
-| No mapping by default, so http status is 200
-
-| UNKNOWN
-| No mapping by default, so http status is 200
-|===
-
-
-
-[[actuator.endpoints.health.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 {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` should be used to register and unregister health indicators at runtime.
-If you need to register a regular `HealthContributor`, you should wrap it using `ReactiveHealthContributor#adapt`.
-
-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,pending-extract=true,indent=0]
-----
- @Component
- public class MyReactiveHealthIndicator implements ReactiveHealthIndicator {
-
- @Override
- public Mono health() {
- return doHealthCheck() //perform some specific health check that returns a Mono
- .onErrorResume(ex -> Mono.just(new Health.Builder().down(ex).build()));
- }
-
- }
-----
-
-TIP: To handle the error automatically, consider extending from `AbstractReactiveHealthIndicator`.
-
-
-
-[[actuator.endpoints.health.auto-configured-reactive-health-indicators]]
-==== Auto-configured ReactiveHealthIndicators
-The following `ReactiveHealthIndicators` are auto-configured by Spring Boot when appropriate:
-
-[cols="2,4,6"]
-|===
-| Key | Name | Description
-
-| `cassandra`
-| {spring-boot-actuator-module-code}/cassandra/CassandraDriverReactiveHealthIndicator.java[`CassandraDriverReactiveHealthIndicator`]
-| Checks that a Cassandra database is up.
-
-| `couchbase`
-| {spring-boot-actuator-module-code}/couchbase/CouchbaseReactiveHealthIndicator.java[`CouchbaseReactiveHealthIndicator`]
-| Checks that a Couchbase cluster is up.
-
-| `elasticsearch`
-| {spring-boot-actuator-module-code}/elasticsearch/ElasticsearchReactiveHealthIndicator.java[`ElasticsearchReactiveHealthIndicator`]
-| Checks that an Elasticsearch cluster is up.
-
-| `mongo`
-| {spring-boot-actuator-module-code}/mongo/MongoReactiveHealthIndicator.java[`MongoReactiveHealthIndicator`]
-| Checks that a Mongo database is up.
-
-| `neo4j`
-| {spring-boot-actuator-module-code}/neo4j/Neo4jReactiveHealthIndicator.java[`Neo4jReactiveHealthIndicator`]
-| Checks that a Neo4j database is up.
-
-| `redis`
-| {spring-boot-actuator-module-code}/redis/RedisReactiveHealthIndicator.java[`RedisReactiveHealthIndicator`]
-| Checks that a Redis server is up.
-|===
-
-TIP: If necessary, reactive indicators replace the regular ones.
-Also, any `HealthIndicator` that is not handled explicitly is wrapped automatically.
-
-
-
-[[actuator.endpoints.health.groups]]
-==== Health Groups
-It's sometimes useful to organize health indicators into groups that can be used for different purposes.
-
-To create a health indicator group you can use the `management.endpoint.health.group.` property and specify a list of health indicator IDs to `include` or `exclude`.
-For example, to create a group that includes only database indicators you can define the following:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoint:
- health:
- group:
- custom:
- include: "db"
-----
-
-You can then check the result by hitting `http://localhost:8080/actuator/health/custom`.
-
-Similarly, to create a group that excludes the database indicators from the group and includes all the other indicators, you can define the following:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoint:
- health:
- group:
- custom:
- exclude: "db"
-----
-
-By default groups will inherit the same `StatusAggregator` and `HttpCodeStatusMapper` settings as the system health, however, these can also be defined on a per-group basis.
-It's also possible to override the `show-details` and `roles` properties if required:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoint:
- health:
- group:
- custom:
- show-details: "when-authorized"
- roles: "admin"
- status:
- order: "fatal,up"
- http-mapping:
- fatal: 500
- out-of-service: 500
-----
-
-TIP: You can use `@Qualifier("groupname")` if you need to register custom `StatusAggregator` or `HttpCodeStatusMapper` beans for use with the group.
-
-
-
-[[actuator.endpoints.health.datasource]]
-==== DataSource Health
-The `DataSource` health indicator shows the health of both standard data source and routing data source beans.
-The health of a routing data source includes the health of each of its target data sources.
-In the health endpoint's response, each of a routing data source's targets is named using its routing key.
-If you prefer not to include routing data sources in the indicator's output, set configprop:management.health.db.ignore-routing-data-sources[] to `true`.
-
-
-
-[[actuator.endpoints.kubernetes-probes]]
-=== Kubernetes Probes
-Applications deployed on Kubernetes can provide information about their internal state with https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes[Container Probes].
-Depending on https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/[your Kubernetes configuration], the kubelet will call those probes and react to the result.
-
-Spring Boot manages your <> out-of-the-box.
-If deployed in a Kubernetes environment, actuator will gather the "Liveness" and "Readiness" information from the `ApplicationAvailability` interface and use that information in dedicated <>: `LivenessStateHealthIndicator` and `ReadinessStateHealthIndicator`.
-These indicators will be shown on the global health endpoint (`"/actuator/health"`).
-They will also be exposed as separate HTTP Probes using <>: `"/actuator/health/liveness"` and `"/actuator/health/readiness"`.
-
-You can then configure your Kubernetes infrastructure with the following endpoint information:
-
-[source,yml,indent=0]
-----
-livenessProbe:
- httpGet:
- path: /actuator/health/liveness
- port:
- failureThreshold: ...
- periodSeconds: ...
-
-readinessProbe:
- httpGet:
- path: /actuator/health/readiness
- port:
- failureThreshold: ...
- periodSeconds: ...
-----
-
-NOTE: `` should be set to the port that the actuator endpoints are available on.
-It could be the main web server port, or a separate management port if the `"management.server.port"` property has been set.
-
-These health groups are only enabled automatically if the application is <>.
-You can enable them in any environment using the configprop:management.endpoint.health.probes.enabled[] configuration property.
-
-NOTE: If an application takes longer to start than the configured liveness period, Kubernetes mention the `"startupProbe"` as a possible solution.
-The `"startupProbe"` is not necessarily needed here as the `"readinessProbe"` fails until all startup tasks are done, see <>.
-
-WARNING: If your Actuator endpoints are deployed on a separate management context, be aware that endpoints are then not using the same web infrastructure (port, connection pools, framework components) as the main application.
-In this case, a probe check could be successful even if the main application does not work properly (for example, it cannot accept new connections).
-
-
-
-[[actuator.endpoints.kubernetes-probes.external-state]]
-==== Checking External State with Kubernetes Probes
-Actuator configures the "liveness" and "readiness" probes as Health Groups; this means that all the <> are available for them.
-You can, for example, configure additional Health Indicators:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoint:
- health:
- group:
- readiness:
- include: "readinessState,customCheck"
-----
-
-By default, Spring Boot does not add other Health Indicators to these groups.
-
-The "`liveness`" Probe should not depend on health checks for external systems.
-If the <> is broken, Kubernetes will try to solve that problem by restarting the application instance.
-This means that if an external system fails (e.g. a database, a Web API, an external cache), Kubernetes might restart all application instances and create cascading failures.
-
-As for the "`readiness`" Probe, the choice of checking external systems must be made carefully by the application developers, i.e. Spring Boot does not include any additional health checks in the readiness probe.
-If the <> is unready, Kubernetes will not route traffic to that instance.
-Some external systems might not be shared by application instances, in which case they could quite naturally be included in a readiness probe.
-Other external systems might not be essential to the application (the application could have circuit breakers and fallbacks), in which case they definitely should not be included.
-Unfortunately, an external system that is shared by all application instances is common, and you have to make a judgement call: include it in the readiness probe and expect that the application is taken out of service when the external service is down, or leave it out and deal with failures higher up the stack, e.g. using a circuit breaker in the caller.
-
-NOTE: If all instances of an application are unready, a Kubernetes Service with `type=ClusterIP` or `NodePort` will not accept any incoming connections.
-There is no HTTP error response (503 etc.) since there is no connection.
-A Service with `type=LoadBalancer` might or might not accept connections, depending on the provider.
-A Service that has an explicit https://kubernetes.io/docs/concepts/services-networking/ingress/[Ingress] will also respond in a way that depends on the implementation - the ingress service itself will have to decide how to handle the "connection refused" from downstream.
-HTTP 503 is quite likely in the case of both load balancer and ingress.
-
-Also, if an application is using Kubernetes https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/[autoscaling] it may react differently to applications being taken out of the load-balancer, depending on its autoscaler configuration.
-
-
-
-[[actuator.endpoints.kubernetes-probes.lifecycle]]
-==== Application Lifecycle and Probe States
-An important aspect of the Kubernetes Probes support is its consistency with the application lifecycle.
-There is a significant difference between the `AvailabilityState` which is the in-memory, internal state of the application
-and the actual Probe which exposes that state: depending on the phase of application lifecycle, the Probe might not be available.
-
-Spring Boot publishes <>,
-and Probes can listen to such events and expose the `AvailabilityState` information.
-
-The following tables show the `AvailabilityState` and the state of HTTP connectors at different stages.
-
-When a Spring Boot application starts:
-
-[cols="2,2,2,3,5"]
-|===
-|Startup phase |LivenessState |ReadinessState |HTTP server |Notes
-
-|Starting
-|`BROKEN`
-|`REFUSING_TRAFFIC`
-|Not started
-|Kubernetes checks the "liveness" Probe and restarts the application if it takes too long.
-
-|Started
-|`CORRECT`
-|`REFUSING_TRAFFIC`
-|Refuses requests
-|The application context is refreshed. The application performs startup tasks and does not receive traffic yet.
-
-|Ready
-|`CORRECT`
-|`ACCEPTING_TRAFFIC`
-|Accepts requests
-|Startup tasks are finished. The application is receiving traffic.
-|===
-
-When a Spring Boot application shuts down:
-
-[cols="2,2,2,3,5"]
-|===
-|Shutdown phase |Liveness State |Readiness State |HTTP server |Notes
-
-|Running
-|`CORRECT`
-|`ACCEPTING_TRAFFIC`
-|Accepts requests
-|Shutdown has been requested.
-
-|Graceful shutdown
-|`CORRECT`
-|`REFUSING_TRAFFIC`
-|New requests are rejected
-|If enabled, <>.
-
-|Shutdown complete
-|N/A
-|N/A
-|Server is shut down
-|The application context is closed and the application is shut down.
-|===
-
-TIP: Check out the <> for more information about Kubernetes deployment.
-
-
-
-[[actuator.endpoints.info]]
-=== Application Information
-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.
-
-
-
-[[actuator.endpoints.info.auto-configured-info-contributors]]
-==== Auto-configured InfoContributors
-The following `InfoContributor` beans are auto-configured by Spring Boot, when appropriate:
-
-[cols="1,4"]
-|===
-| Name | Description
-
-| {spring-boot-actuator-module-code}/info/EnvironmentInfoContributor.java[`EnvironmentInfoContributor`]
-| Exposes any key from the `Environment` under the `info` key.
-
-| {spring-boot-actuator-module-code}/info/GitInfoContributor.java[`GitInfoContributor`]
-| Exposes git information if a `git.properties` file is available.
-
-| {spring-boot-actuator-module-code}/info/BuildInfoContributor.java[`BuildInfoContributor`]
-| Exposes build information if a `META-INF/build-info.properties` file is available.
-|===
-
-TIP: It is possible to disable them all by setting the configprop:management.info.defaults.enabled[] property.
-
-
-
-[[actuator.endpoints.info.custom-application-information]]
-==== Custom Application Information
-You can customize the data exposed by the `info` endpoint by setting `+info.*+` Spring properties.
-All `Environment` properties under the `info` key are automatically exposed.
-For example, you could add the following settings to your `application.properties` file:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- info:
- app:
- encoding: "UTF-8"
- java:
- source: "11"
- target: "11"
-----
-
-[TIP]
-====
-Rather than hardcoding those values, you could also <>.
-
-Assuming you use Maven, you could rewrite the preceding example as follows:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- info:
- app:
- encoding: "@project.build.sourceEncoding@"
- java:
- source: "@java.version@"
- target: "@java.version@"
-----
-====
-
-
-
-[[actuator.endpoints.info.git-commit-information]]
-==== Git Commit Information
-Another useful feature of the `info` endpoint is its ability to publish information about the state of your `git` source code repository when the project was built.
-If a `GitProperties` bean is available, the `info` endpoint can be used to expose these properties.
-
-TIP: A `GitProperties` bean is auto-configured if a `git.properties` file is available at the root of the classpath.
-See "<>" for more details.
-
-By default, the endpoint exposes `git.branch`, `git.commit.id`, and `git.commit.time` properties, if present.
-If you don't want any of these properties in the endpoint response, they need to be excluded from the `git.properties` file.
-If you want to display the full git information (that is, the full content of `git.properties`), use the configprop:management.info.git.mode[] property, as follows:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- info:
- git:
- mode: "full"
-----
-
-To disable the git commit information from the `info` endpoint completely, set the configprop:management.info.git.enabled[] property to `false`, as follows:
-
-[source,properties,indent=0,configprops]
-----
- management.info.git.enabled=false
-----
-
-
-
-[[actuator.endpoints.info.build-information]]
-==== Build Information
-If a `BuildProperties` bean is available, the `info` endpoint can also publish information about your build.
-This happens if a `META-INF/build-info.properties` file is available in the classpath.
-
-TIP: The Maven and Gradle plugins can both generate that file.
-See "<>" for more details.
-
-
-
-[[actuator.endpoints.info.writing-custom-info-contributors]]
-==== Writing Custom InfoContributors
-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:
-
-[source,java,pending-extract=true,indent=0]
-----
- import java.util.Collections;
-
- import org.springframework.boot.actuate.info.Info;
- import org.springframework.boot.actuate.info.InfoContributor;
- import org.springframework.stereotype.Component;
-
- @Component
- public class ExampleInfoContributor implements InfoContributor {
-
- @Override
- public void contribute(Info.Builder builder) {
- builder.withDetail("example",
- Collections.singletonMap("key", "value"));
- }
-
- }
-----
-
-If you reach the `info` endpoint, you should see a response that contains the following additional entry:
-
-[source,json,indent=0]
-----
- {
- "example": {
- "key" : "value"
- }
- }
-----
-
-
-
-[[actuator.monitoring]]
-== Monitoring and Management over HTTP
-If you are developing a web application, Spring Boot Actuator auto-configures all enabled endpoints to be exposed over HTTP.
-The default convention is to use the `id` of the endpoint with a prefix of `/actuator` as the URL path.
-For example, `health` is exposed as `/actuator/health`.
-
-TIP: Actuator is supported natively with Spring MVC, Spring WebFlux, and Jersey.
-If both Jersey and Spring MVC are available, Spring MVC will be used.
-
-NOTE: Jackson is a required dependency in order to get the correct JSON responses as documented in the API documentation ({spring-boot-actuator-restapi-docs}[HTML] or {spring-boot-actuator-restapi-pdfdocs}[PDF]).
-
-
-
-[[actuator.monitoring.customizing-management-server-context-path]]
-=== Customizing the Management Endpoint Paths
-Sometimes, it is useful to customize the prefix for the management endpoints.
-For example, your application might already use `/actuator` for another purpose.
-You can use the configprop:management.endpoints.web.base-path[] property to change the prefix for your management endpoint, as shown in the following example:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoints:
- web:
- base-path: "/manage"
-----
-
-The preceding `application.properties` example changes the endpoint from `/actuator/\{id}` to `/manage/\{id}` (for example, `/manage/info`).
-
-NOTE: Unless the management port has been configured to <>, `management.endpoints.web.base-path` is relative to `server.servlet.context-path` (Servlet web applications) or `spring.webflux.base-path` (reactive web applications).
-If `management.server.port` is configured, `management.endpoints.web.base-path` is relative to `management.server.base-path`.
-
-If you want to map endpoints to a different path, you can use the configprop:management.endpoints.web.path-mapping[] property.
-
-The following example remaps `/actuator/health` to `/healthcheck`:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoints:
- web:
- base-path: "/"
- path-mapping:
- health: "healthcheck"
-----
-
-
-
-[[actuator.monitoring.customizing-management-server-port]]
-=== Customizing the Management Server Port
-Exposing management endpoints by using the default HTTP port is a sensible choice for cloud-based deployments.
-If, however, your application runs inside your own data center, you may prefer to expose endpoints by using a different HTTP port.
-
-You can set the configprop:management.server.port[] property to change the HTTP port, as shown in the following example:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- server:
- port: 8081
-----
-
-NOTE: On Cloud Foundry, applications only receive requests on port 8080 for both HTTP and TCP routing, by default.
-If you want to use a custom management port on Cloud Foundry, you will need to explicitly set up the application's routes to forward traffic to the custom port.
-
-
-
-[[actuator.monitoring.management-specific-ssl]]
-=== Configuring Management-specific SSL
-When configured to use a custom port, the management server can also be configured with its own SSL by using the various `management.server.ssl.*` properties.
-For example, doing so lets a management server be available over HTTP while the main application uses HTTPS, as shown in the following property settings:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- server:
- port: 8443
- ssl:
- enabled: true
- key-store: "classpath:store.jks"
- key-password: secret
- management:
- server:
- port: 8080
- ssl:
- enabled: false
-----
-
-Alternatively, both the main server and the management server can use SSL but with different key stores, as follows:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- server:
- port: 8443
- ssl:
- enabled: true
- key-store: "classpath:main.jks"
- key-password: "secret"
- management:
- server:
- port: 8080
- ssl:
- enabled: true
- key-store: "classpath:management.jks"
- key-password: "secret"
-----
-
-
-
-[[actuator.monitoring.customizing-management-server-address]]
-=== Customizing the Management Server Address
-You can customize the address that the management endpoints are available on by setting the configprop:management.server.address[] property.
-Doing so can be useful if you want to listen only on an internal or ops-facing network or to listen only for connections from `localhost`.
-
-NOTE: You can listen on a different address only when the port differs from the main server port.
-
-The following example `application.properties` does not allow remote management connections:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- server:
- port: 8081
- address: "127.0.0.1"
-----
-
-
-
-[[actuator.monitoring.disabling-http-endpoints]]
-=== Disabling HTTP Endpoints
-If you do not want to expose endpoints over HTTP, you can set the management port to `-1`, as shown in the following example:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- server:
- port: -1
-----
-
-This can be achieved using the configprop:management.endpoints.web.exposure.exclude[] property as well, as shown in the following example:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoints:
- web:
- exposure:
- exclude: "*"
-----
-
-
-
-[[actuator.jmx]]
-== Monitoring and Management over JMX
-Java Management Extensions (JMX) provide a standard mechanism to monitor and manage applications.
-By default, this feature is not enabled and can be turned on by setting the configuration property configprop:spring.jmx.enabled[] to `true`.
-Spring Boot exposes management endpoints as JMX MBeans under the `org.springframework.boot` domain by default.
-To Take full control over endpoints registration in the JMX domain, consider registering your own `EndpointObjectNameFactory` implementation.
-
-
-
-[[actuator.jmx.custom-mbean-names]]
-=== Customizing MBean Names
-The name of the MBean is usually generated from the `id` of the endpoint.
-For example, the `health` endpoint is exposed as `org.springframework.boot:type=Endpoint,name=Health`.
-
-If your application contains more than one Spring `ApplicationContext`, you may find that names clash.
-To solve this problem, you can set the configprop:spring.jmx.unique-names[] property to `true` so that MBean names are always unique.
-
-You can also customize the JMX domain under which endpoints are exposed.
-The following settings show an example of doing so in `application.properties`:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- spring:
- jmx:
- unique-names: true
- management:
- endpoints:
- jmx:
- domain: "com.example.myapp"
-----
-
-
-
-[[actuator.jmx.disable-jmx-endpoints]]
-=== Disabling JMX Endpoints
-If you do not want to expose endpoints over JMX, you can set the configprop:management.endpoints.jmx.exposure.exclude[] property to `*`, as shown in the following example:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoints:
- jmx:
- exposure:
- exclude: "*"
-----
-
-
-
-[[actuator.jmx.jolokia]]
-=== Using Jolokia for JMX over HTTP
-Jolokia is a JMX-HTTP bridge that provides an alternative method of accessing JMX beans.
-To use Jolokia, include a dependency to `org.jolokia:jolokia-core`.
-For example, with Maven, you would add the following dependency:
-
-[source,xml,indent=0]
-----
-
- org.jolokia
- jolokia-core
-
-----
-
-The Jolokia endpoint can then be exposed by adding `jolokia` or `*` to the configprop:management.endpoints.web.exposure.include[] property.
-You can then access it by using `/actuator/jolokia` on your management HTTP server.
-
-NOTE: The Jolokia endpoint exposes Jolokia's servlet as an actuator endpoint.
-As a result, it is specific to servlet environments such as Spring MVC and Jersey.
-The endpoint will not be available in a WebFlux application.
-
-
-
-[[actuator.jmx.jolokia.customizing]]
-==== Customizing Jolokia
-Jolokia has a number of settings that you would traditionally configure by setting servlet parameters.
-With Spring Boot, you can use your `application.properties` file.
-To do so, prefix the parameter with `management.endpoint.jolokia.config.`, as shown in the following example:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoint:
- jolokia:
- config:
- debug: true
-----
-
-
-
-[[actuator.jmx.jolokia.disabling]]
-==== Disabling Jolokia
-If you use Jolokia but do not want Spring Boot to configure it, set the configprop:management.endpoint.jolokia.enabled[] property to `false`, as follows:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- endpoint:
- jolokia:
- enabled: false
-----
-
-
-
-[[actuator.loggers]]
-== Loggers
-Spring Boot Actuator includes the ability to view and configure the log levels of your application at runtime.
-You can view either the entire list or an individual logger's configuration, which is made up of both the explicitly configured logging level as well as the effective logging level given to it by the logging framework.
-These levels can be one of:
-
-* `TRACE`
-* `DEBUG`
-* `INFO`
-* `WARN`
-* `ERROR`
-* `FATAL`
-* `OFF`
-* `null`
-
-`null` indicates that there is no explicit configuration.
-
-
-
-[[actuator.loggers.configure]]
-=== Configure a Logger
-To configure a given logger, `POST` a partial entity to the resource's URI, as shown in the following example:
-
-[source,json,indent=0]
-----
- {
- "configuredLevel": "DEBUG"
- }
-----
-
-TIP: To "`reset`" the specific level of the logger (and use the default configuration instead), you can pass a value of `null` as the `configuredLevel`.
-
-
-
-[[actuator.metrics]]
-== Metrics
-Spring Boot Actuator provides dependency management and auto-configuration for https://micrometer.io[Micrometer], an application metrics facade that supports {micrometer-docs}[numerous monitoring systems], including:
-
-- <>
-- <>
-- <>
-- <>
-- <>
-- <>
-- <>
-- <>
-- <>
-- <>
-- <>
-- <>
-- <>
-- <>
-- <>
-- <>
-- <>
-- <>
-
-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].
-
-
-
-[[actuator.metrics.getting-started]]
-=== Getting started
-Spring Boot auto-configures a composite `MeterRegistry` and adds a registry to the composite for each of the supported implementations that it finds on the classpath.
-Having a dependency on `micrometer-registry-\{system}` in your runtime classpath is enough for Spring Boot to configure the registry.
-
-Most registries share common features.
-For instance, you can disable a particular registry even if the Micrometer registry implementation is on the classpath.
-For example, to disable Datadog:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- datadog:
- enabled: false
-----
-
-You can also disable all registries unless stated otherwise by the registry-specific property, as shown in the following example:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- defaults:
- enabled: false
-----
-
-Spring Boot will also add any auto-configured registries to the global static composite registry on the `Metrics` class unless you explicitly tell it not to:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- use-global-registry: false
-----
-
-You can register any number of `MeterRegistryCustomizer` beans to further configure the registry, such as applying common tags, before any meters are registered with the registry:
-
-[source,java,pending-extract=true,indent=0]
-----
- @Bean
- MeterRegistryCustomizer metricsCommonTags() {
- return registry -> registry.config().commonTags("region", "us-east-1");
- }
-----
-
-You can apply customizations to particular registry implementations by being more specific about the generic type:
-
-[source,java,pending-extract=true,indent=0]
-----
- @Bean
- MeterRegistryCustomizer graphiteMetricsNamingConvention() {
- return registry -> registry.config().namingConvention(MY_CUSTOM_CONVENTION);
- }
-----
-
-Spring Boot also <> that you can control via configuration or dedicated annotation markers.
-
-
-
-[[actuator.metrics.export]]
-=== Supported Monitoring Systems
-
-
-
-[[actuator.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-docs}/appOptics[AppOptics], your API token must be provided:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- appoptics:
- api-token: "YOUR_TOKEN"
-----
-
-
-
-[[actuator.metrics.export.atlas]]
-==== Atlas
-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,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- atlas:
- uri: "https://atlas.example.com:7101/api/v1/publish"
-----
-
-
-
-[[actuator.metrics.export.datadog]]
-==== Datadog
-Datadog registry pushes metrics to https://www.datadoghq.com[datadoghq] periodically.
-To export metrics to {micrometer-registry-docs}/datadog[Datadog], your API key must be provided:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- datadog:
- api-key: "YOUR_KEY"
-----
-
-You can also change the interval at which metrics are sent to Datadog:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- datadog:
- step: "30s"
-----
-
-
-
-[[actuator.metrics.export.dynatrace]]
-==== Dynatrace
-Dynatrace registry pushes metrics to the configured URI periodically.
-To export metrics to {micrometer-registry-docs}/dynatrace[Dynatrace], your API token, device ID, and URI must be provided:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- dynatrace:
- api-token: "YOUR_TOKEN"
- device-id: "YOUR_DEVICE_ID"
- uri: "YOUR_URI"
-----
-
-You can also change the interval at which metrics are sent to Dynatrace:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- dynatrace:
- step: "30s"
-----
-
-
-
-[[actuator.metrics.export.elastic]]
-==== Elastic
-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,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- elastic:
- host: "https://elastic.example.com:8086"
-----
-
-
-
-[[actuator.metrics.export.ganglia]]
-==== Ganglia
-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,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- ganglia:
- host: "ganglia.example.com"
- port: 9649
-----
-
-
-
-[[actuator.metrics.export.graphite]]
-==== Graphite
-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,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- graphite:
- host: "graphite.example.com"
- port: 9004
-----
-
-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:
-
-[source,java,pending-extract=true,indent=0]
-----
- @Bean
- public GraphiteMeterRegistry graphiteMeterRegistry(GraphiteConfig config, Clock clock) {
- return new GraphiteMeterRegistry(config, clock, MY_HIERARCHICAL_MAPPER);
- }
-----
-
-
-
-[[actuator.metrics.export.humio]]
-==== Humio
-By default, the Humio registry pushes metrics to https://cloud.humio.com periodically.
-To export metrics to SaaS {micrometer-registry-docs}/humio[Humio], your API token must be provided:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- humio:
- api-token: "YOUR_TOKEN"
-----
-
-You should also configure one or more tags to identify the data source to which metrics will be pushed:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- humio:
- tags:
- alpha: "a"
- bravo: "b"
-----
-
-
-
-[[actuator.metrics.export.influx]]
-==== Influx
-By default, metrics are exported to an {micrometer-registry-docs}/influx[Influx] v1 instance running on your local machine with the default configuration.
-To export metrics to InfluxDB v2, configure the `org`, `bucket`, and authentication `token` for writing metrics.
-The location of the https://www.influxdata.com[Influx server] to use can be provided using:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- influx:
- uri: "https://influx.example.com:8086"
-----
-
-
-
-[[actuator.metrics.export.jmx]]
-==== JMX
-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:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- jmx:
- domain: "com.example.app.metrics"
-----
-
-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:
-
-[source,java,pending-extract=true,indent=0]
-----
- @Bean
- public JmxMeterRegistry jmxMeterRegistry(JmxConfig config, Clock clock) {
- return new JmxMeterRegistry(config, clock, MY_HIERARCHICAL_MAPPER);
- }
-----
-
-
-
-[[actuator.metrics.export.kairos]]
-==== KairosDB
-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,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- kairos:
- uri: "https://kairosdb.example.com:8080/api/v1/datapoints"
-----
-
-
-
-[[actuator.metrics.export.newrelic]]
-==== New Relic
-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,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- newrelic:
- api-key: "YOUR_KEY"
- account-id: "YOUR_ACCOUNT_ID"
-----
-
-You can also change the interval at which metrics are sent to New Relic:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- newrelic:
- step: "30s"
-----
-
-By default, metrics are published via REST calls but it is also possible to use the Java Agent API if you have it on the classpath:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- newrelic:
- client-provider-type: "insights-agent"
-----
-
-Finally, you can take full control by defining your own `NewRelicClientProvider` bean.
-
-
-
-[[actuator.metrics.export.prometheus]]
-==== Prometheus
-{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 <> for more details.
-
-Here is an example `scrape_config` to add to `prometheus.yml`:
-
-[source,yaml,indent=0]
-----
- scrape_configs:
- - job_name: 'spring'
- metrics_path: '/actuator/prometheus'
- static_configs:
- - targets: ['HOST:PORT']
-----
-
-For ephemeral or batch jobs which may not exist long enough to be scraped, https://github.com/prometheus/pushgateway[Prometheus Pushgateway] support can be used to expose their metrics to Prometheus.
-To enable Prometheus Pushgateway support, add the following dependency to your project:
-
-[source,xml,indent=0]
-----
-
- io.prometheus
- simpleclient_pushgateway
-
-----
-
-When the Prometheus Pushgateway dependency is present on the classpath and the configprop:management.metrics.export.prometheus.pushgateway.enabled[] property is set to `true`, a `PrometheusPushGatewayManager` bean is auto-configured.
-This manages the pushing of metrics to a Prometheus Pushgateway.
-
-The `PrometheusPushGatewayManager` can be tuned using properties under `management.metrics.export.prometheus.pushgateway`.
-For advanced configuration, you can also provide your own `PrometheusPushGatewayManager` bean.
-
-
-
-[[actuator.metrics.export.signalfx]]
-==== SignalFx
-SignalFx registry pushes metrics to {micrometer-registry-docs}/signalFx[SignalFx] periodically.
-To export metrics to https://www.signalfx.com[SignalFx], your access token must be provided:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- signalfx:
- access-token: "YOUR_ACCESS_TOKEN"
-----
-
-You can also change the interval at which metrics are sent to SignalFx:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- signalfx:
- step: "30s"
-----
-
-
-
-[[actuator.metrics.export.simple]]
-==== Simple
-Micrometer ships with a simple, in-memory backend that is automatically used as a fallback if no other registry is configured.
-This allows you to see what metrics are collected in the <>.
-
-The in-memory backend disables itself as soon as you're using any of the other available backend.
-You can also disable it explicitly:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- simple:
- enabled: false
-----
-
-
-
-[[actuator.metrics.export.stackdriver]]
-==== Stackdriver
-Stackdriver registry pushes metrics to https://cloud.google.com/stackdriver/[Stackdriver] periodically.
-To export metrics to SaaS {micrometer-registry-docs}/stackdriver[Stackdriver], your Google Cloud project id must be provided:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- stackdriver:
- project-id: "my-project"
-----
-
-You can also change the interval at which metrics are sent to Stackdriver:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- stackdriver:
- step: "30s"
-----
-
-
-
-[[actuator.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-docs}/statsD[StatsD] agent running on your local machine.
-The StatsD agent host, port, and protocol to use can be provided using:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- statsd:
- host: "statsd.example.com"
- port: 9125
- protocol: "udp"
-----
-
-You can also change the StatsD line protocol to use (default to Datadog):
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- statsd:
- flavor: "etsy"
-----
-
-
-
-[[actuator.metrics.export.wavefront]]
-==== Wavefront
-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,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- wavefront:
- api-token: "YOUR_API_TOKEN"
-----
-
-Alternatively, you may use a Wavefront sidecar or an internal proxy set up in your environment that forwards metrics data to the Wavefront API host:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- wavefront:
- uri: "proxy://localhost:2878"
-----
-
-TIP: If publishing metrics to a Wavefront proxy (as described in https://docs.wavefront.com/proxies_installing.html[the documentation]), the host must be in the `proxy://HOST:PORT` format.
-
-You can also change the interval at which metrics are sent to Wavefront:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- export:
- wavefront:
- step: "30s"
-----
-
-
-
-[[actuator.metrics.supported]]
-=== Supported Metrics and Meters
-Spring Boot provides automatic meter registration for a wide variety of technologies.
-In most situations, the out-of-the-box defaults will provide sensible metrics that can be published to any of the supported monioring systems.
-
-
-
-[[actuator.metrics.supported.jvm]]
-==== JVM Metrics
-Auto-configuration will enable JVM Metrics using core Micrometer classes.
-JVM metrics are published under the `jvm.` meter name.
-
-The following JVM metrics are provided:
-
-* Various memory and buffer pool details
-* Statistics related to garbage collection
-* Threads utilization
-* The Number of classes loaded/unloaded
-
-
-
-[[actuator.metrics.supported.system]]
-==== System Metrics
-Auto-configuration will enable system metrics using core Micrometer classes.
-System metrics are published under the `system.` and `process.` meter names.
-
-The following system metrics are provided:
-
-* CPU metrics
-* File descriptor metrics
-* Uptime metrics (both the amount of time the application has been running as well as a fixed gauge of the absolute start time)
-
-
-
-[[actuator.metrics.supported.logger]]
-==== Logger Metrics
-Auto-configuration enables the event metrics for both Logback and Log4J2.
-Details are published under the `log4j2.events.` or `logback.events.` meter names.
-
-
-
-[[actuator.metrics.supported.spring-mvc]]
-==== Spring MVC Metrics
-Auto-configuration enables the instrumentation of all requests handled by Spring MVC controllers and functional handlers.
-By default, metrics are generated with the name, `http.server.requests`.
-The name can be customized by setting the configprop:management.metrics.web.server.request.metric-name[] property.
-
-`@Timed` annotations are supported on `@Controller` classes and `@RequestMapping` methods (see <> for details).
-If you don't want to record metrics for all Spring MVC requests, you can set configprop:management.metrics.web.server.request.autotime.enabled[] to `false` and exclusively use `@Timed` annotations instead.
-
-By default, Spring MVC related metrics are tagged with the following information:
-
-|===
-| Tag | Description
-
-| `exception`
-| Simple class name of any exception that was thrown while handling the request.
-
-| `method`
-| Request's method (for example, `GET` or `POST`)
-
-| `outcome`
-| Request's outcome based on the status code of the response.
- 1xx is `INFORMATIONAL`, 2xx is `SUCCESS`, 3xx is `REDIRECTION`, 4xx `CLIENT_ERROR`, and 5xx is `SERVER_ERROR`
-
-| `status`
-| Response's HTTP status code (for example, `200` or `500`)
-
-| `uri`
-| Request's URI template prior to variable substitution, if possible (for example, `/api/person/\{id}`)
-|===
-
-To add to the default tags, provide one or more ``@Bean``s that implement `WebMvcTagsContributor`.
-To replace the default tags, provide a `@Bean` that implements `WebMvcTagsProvider`.
-
-TIP: In some cases, exceptions handled in Web controllers are not recorded as request metrics tags.
-Applications can opt-in and record exceptions by <>.
-
-
-
-[[actuator.metrics.supported.spring-webflux]]
-==== Spring WebFlux Metrics
-Auto-configuration enables the instrumentation of all requests handled by Spring WebFlux controllers and functional handlers.
-By default, metrics are generated with the name, `http.server.requests`.
-The name can be customized by setting the configprop:management.metrics.web.server.request.metric-name[] property.
-
-`@Timed` annotations are supported on `@Controller` classes and `@RequestMapping` methods (see <> for details).
-If you don't want to record metrics for all Spring WebFlux requests, you can set configprop:management.metrics.web.server.request.autotime.enabled[] to `false` and exclusively use `@Timed` annotations instead.
-
-By default, WebFlux related metrics are tagged with the following information:
-
-|===
-| Tag | Description
-
-| `exception`
-| Simple class name of any exception that was thrown while handling the request.
-
-| `method`
-| Request's method (for example, `GET` or `POST`)
-
-| `outcome`
-| Request's outcome based on the status code of the response.
- 1xx is `INFORMATIONAL`, 2xx is `SUCCESS`, 3xx is `REDIRECTION`, 4xx `CLIENT_ERROR`, and 5xx is `SERVER_ERROR`
-
-| `status`
-| Response's HTTP status code (for example, `200` or `500`)
-
-| `uri`
-| Request's URI template prior to variable substitution, if possible (for example, `/api/person/\{id}`)
-|===
-
-To add to the default tags, provide one or more ``@Bean``s that implement `WebFluxTagsContributor`.
-To replace the default tags, provide a `@Bean` that implements `WebFluxTagsProvider`.
-
-TIP: In some cases, exceptions handled in controllers and handler functions are not recorded as request metrics tags.
-Applications can opt-in and record exceptions by <>.
-
-
-
-[[actuator.metrics.supported.jersey]]
-==== Jersey Server Metrics
-Auto-configuration enables the instrumentation of all requests handled by the Jersey JAX-RS implementation whenever Micrometer's `micrometer-jersey2` module is on the classpath.
-By default, metrics are generated with the name, `http.server.requests`.
-The name can be customized by setting the configprop:management.metrics.web.server.request.metric-name[] property.
-
-`@Timed` annotations are supported on request-handling classes and methods (see <> for details).
-If you don't want to record metrics for all Jersey requests, you can set configprop:management.metrics.web.server.request.autotime.enabled[] to `false` and exclusively use `@Timed` annotations instead.
-
-By default, Jersey server metrics are tagged with the following information:
-
-|===
-| Tag | Description
-
-| `exception`
-| Simple class name of any exception that was thrown while handling the request.
-
-| `method`
-| Request's method (for example, `GET` or `POST`)
-
-| `outcome`
-| Request's outcome based on the status code of the response.
- 1xx is `INFORMATIONAL`, 2xx is `SUCCESS`, 3xx is `REDIRECTION`, 4xx `CLIENT_ERROR`, and 5xx is `SERVER_ERROR`
-
-| `status`
-| Response's HTTP status code (for example, `200` or `500`)
-
-| `uri`
-| Request's URI template prior to variable substitution, if possible (for example, `/api/person/\{id}`)
-|===
-
-To customize the tags, provide a `@Bean` that implements `JerseyTagsProvider`.
-
-
-
-[[actuator.metrics.supported.http-clients]]
-==== HTTP Client Metrics
-Spring Boot Actuator manages the instrumentation of both `RestTemplate` and `WebClient`.
-For that, you have to inject the auto-configured builder and use it to create instances:
-
-* `RestTemplateBuilder` for `RestTemplate`
-* `WebClient.Builder` for `WebClient`
-
-It is also possible to apply manually the customizers responsible for this instrumentation, namely `MetricsRestTemplateCustomizer` and `MetricsWebClientCustomizer`.
-
-By default, metrics are generated with the name, `http.client.requests`.
-The name can be customized by setting the configprop:management.metrics.web.client.request.metric-name[] property.
-
-By default, metrics generated by an instrumented client are tagged with the following information:
-
-|===
-| Tag | Description
-
-| `clientName`
-| Host portion of the URI
-
-| `method`
-| Request's method (for example, `GET` or `POST`)
-
-| `outcome`
-| Request's outcome based on the status code of the response.
- 1xx is `INFORMATIONAL`, 2xx is `SUCCESS`, 3xx is `REDIRECTION`, 4xx `CLIENT_ERROR`, and 5xx is `SERVER_ERROR`, `UNKNOWN` otherwise
-
-| `status`
-| Response's HTTP status code if available (for example, `200` or `500`), or `IO_ERROR` in case of I/O issues, `CLIENT_ERROR` otherwise
-
-| `uri`
-| Request's URI template prior to variable substitution, if possible (for example, `/api/person/\{id}`)
-|===
-
-To customize the tags, and depending on your choice of client, you can provide a `@Bean` that implements `RestTemplateExchangeTagsProvider` or `WebClientExchangeTagsProvider`.
-There are convenience static functions in `RestTemplateExchangeTags` and `WebClientExchangeTags`.
-
-
-
-[[actuator.metrics.supported.tomcat]]
-==== Tomcat Metrics
-Auto-configuration will enable the instrumentation of Tomcat only when an `MBeanRegistry` is enabled.
-By default, the `MBeanRegistry` is disabled, but you can enable it by setting configprop:server.tomcat.mbeanregistry.enabled[] to `true`.
-
-Tomcat metrics are published under the `tomcat.` meter name.
-
-
-
-[[actuator.metrics.supported.cache]]
-==== Cache Metrics
-Auto-configuration enables the instrumentation of all available ``Cache``s on startup with metrics prefixed with `cache`.
-Cache instrumentation is standardized for a basic set of metrics.
-Additional, cache-specific metrics are also available.
-
-The following cache libraries are supported:
-
-* Caffeine
-* EhCache 2
-* Hazelcast
-* Any compliant JCache (JSR-107) implementation
-* Redis
-
-Metrics are tagged by the name of the cache and by the name of the `CacheManager` that is derived from the bean name.
-
-NOTE: Only caches that are configured on startup are bound to the registry.
-For caches not defined in the cache’s configuration, e.g. caches created on-the-fly or programmatically after the startup phase, an explicit registration is required.
-A `CacheMetricsRegistrar` bean is made available to make that process easier.
-
-
-
-[[actuator.metrics.supported.jdbc]]
-==== DataSource Metrics
-Auto-configuration enables the instrumentation of all available `DataSource` objects with metrics prefixed with `jdbc.connections`.
-Data source instrumentation results in gauges representing the currently active, idle, maximum allowed, and minimum allowed connections in the pool.
-
-Metrics are also tagged by the name of the `DataSource` computed based on the bean name.
-
-TIP: By default, Spring Boot provides metadata for all supported data sources; you can add additional `DataSourcePoolMetadataProvider` beans if your favorite data source isn't supported out of the box.
-See `DataSourcePoolMetadataProvidersConfiguration` for examples.
-
-Also, Hikari-specific metrics are exposed with a `hikaricp` prefix.
-Each metric is tagged by the name of the Pool (can be controlled with `spring.datasource.name`).
-
-
-
-[[actuator.metrics.supported.hibernate]]
-==== Hibernate Metrics
-If `org.hibernate:hibernate-micrometer` is on the classpath, all available Hibernate `EntityManagerFactory` instances that have statistics enabled are instrumented with a metric named `hibernate`.
-
-Metrics are also tagged by the name of the `EntityManagerFactory` that is derived from the bean name.
-
-To enable statistics, the standard JPA property `hibernate.generate_statistics` must be set to `true`.
-You can enable that on the auto-configured `EntityManagerFactory` as shown in the following example:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- spring:
- jpa:
- properties:
- "[hibernate.generate_statistics]": true
-----
-
-
-
-[[actuator.metrics.supported.spring-data-repository]]
-==== Spring Data Repository Metrics
-Auto-configuration enables the instrumentation of all Spring Data `Repository` method invocations.
-By default, metrics are generated with the name, `spring.data.repository.invocations`.
-The name can be customized by setting the configprop:management.metrics.data.repository.metric-name[] property.
-
-`@Timed` annotations are supported on `Repository` classes and methods (see <> for details).
-If you don't want to record metrics for all `Repository` invocations, you can set configprop:management.metrics.data.repository.autotime.enabled[] to `false` and exclusively use `@Timed` annotations instead.
-
-By default, repository invocation related metrics are tagged with the following information:
-
-|===
-| Tag | Description
-
-| `repository`
-| Simple class name of the source `Repository`.
-
-| `method`
-| The name of the `Repository` method that was invoked.
-
-| `state`
-| The result state (`SUCCESS`, `ERROR`, `CANCELED` or `RUNNING`).
-
-| `exception`
-| Simple class name of any exception that was thrown from the invocation.
-|===
-
-To replace the default tags, provide a `@Bean` that implements `RepositoryTagsProvider`.
-
-
-
-[[actuator.metrics.supported.rabbitmq]]
-==== RabbitMQ Metrics
-Auto-configuration will enable the instrumentation of all available RabbitMQ connection factories with a metric named `rabbitmq`.
-
-
-
-[[actuator.metrics.supported.spring-integration]]
-==== Spring Integration Metrics
-Spring Integration provides {spring-integration-docs}system-management.html#micrometer-integration[Micrometer support] automatically whenever a `MeterRegistry` bean is available.
-Metrics are published under the `spring.integration.` meter name.
-
-
-
-[[actuator.metrics.supported.kafka]]
-==== Kafka Metrics
-Auto-configuration will register a `MicrometerConsumerListener` and `MicrometerProducerListener` for the auto-configured consumer factory and producer factory respectively.
-It will also register a `KafkaStreamsMicrometerListener` for `StreamsBuilderFactoryBean`.
-For more details refer to {spring-kafka-docs}#micrometer-native[Micrometer Native Metrics] section of the Spring Kafka documentation.
-
-
-
-[[actuator.metrics.supported.mongodb]]
-==== MongoDB Metrics
-
-
-
-[[actuator.metrics.supported.mongodb.command]]
-===== Command Metrics
-Auto-configuration will register a `MongoMetricsCommandListener` with the auto-configured `MongoClient`.
-
-A timer metric with the name `mongodb.driver.commands` is created for each command issued to the underlying MongoDB driver.
-Each metric is tagged with the following information by default:
-|===
-| Tag | Description
-
-| `command`
-| Name of the command issued
-
-| `cluster.id`
-| Identifier of the cluster the command was sent to
-
-| `server.address`
-| Address of the server the command was sent to
-
-| `status`
-| Outcome of the command - one of (`SUCCESS`, `FAILED`)
-|===
-
-To replace the default metric tags, define a `MongoCommandTagsProvider` bean, as shown in the following example:
-
-[source,java,indent=0]
-----
-include::{include-productionreadyfeatures}/metrics/mongo/SampleCommandTagsProviderConfiguration.java[]
-----
-
-To disable the auto-configured command metrics, set the following property:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- mongo:
- command:
- enabled: false
-----
-
-
-
-[[actuator.metrics.supported.mongodb.connection-pool]]
-===== Connection Pool Metrics
-Auto-configuration will register a `MongoMetricsConnectionPoolListener` with the auto-configured `MongoClient`.
-
-The following gauge metrics are created for the connection pool:
-
-* `mongodb.driver.pool.size` that reports the current size of the connection pool, including idle and and in-use members
-* `mongodb.driver.pool.checkedout` that reports the count of connections that are currently in use
-* `mongodb.driver.pool.waitqueuesize` that reports the current size of the wait queue for a connection from the pool
-
-Each metric is tagged with the following information by default:
-|===
-| Tag | Description
-
-| `cluster.id`
-| Identifier of the cluster the connection pool corresponds to
-
-| `server.address`
-| Address of the server the connection pool corresponds to
-|===
-
-To replace the default metric tags, define a `MongoConnectionPoolTagsProvider` bean, as shown in the following example:
-
-[source,java,indent=0]
-----
-include::{include-productionreadyfeatures}/metrics/mongo/SampleConnectionPoolTagsProviderConfiguration.java[tag=*]
-----
-
-To disable the auto-configured connection pool metrics, set the following property:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- mongo:
- connectionpool:
- enabled: false
-----
-
-
-
-[[actuator.metrics.supported.timed-annotation]]
-==== @Timed Annotation Support
-The `@Timed` annotation from the `io.micrometer.core.annotation` package can be used with several of the supported technologies listed above.
-If supported, the annotation can be used either at the class-level or the method-level.
-
-For example, the following code shows how the annotation can be used to instrument all request mappings in a `@RestController`:
-
-[source,java,pending-extract=true,indent=0]
-----
- @RestController
- @Timed
- public class MyController {
-
- @GetMapping("/api/addresses")
- public List listAddress() { ... }
-
- @GetMapping("/api/people")
- public List listPeople() { ... }
-
- }
-----
-
-If you only want to instrument a single mapping, you can use the annotation on the method instead of the class:
-
-[source,java,pending-extract=true,indent=0]
-----
- @RestController
- public class MyController {
-
- @GetMapping("/api/addresses")
- public List listAddress() { ... }
-
- @GetMapping("/api/people")
- @Timed
- public List listPeople() { ... }
-
- }
-----
-
-You can also combine class-level and method-level annotations if you want to change timing details for a specific method:
-
-[source,java,pending-extract=true,indent=0]
-----
- @RestController
- @Timed
- public class MyController {
-
- @GetMapping("/api/addresses")
- public List listPeople() { ... }
-
- @GetMapping("/api/people")
- @Timed(extraTags = { "region", "us-east-1" })
- @Timed(value = "all.people", longTask = true)
- public List listPeople() { ... }
-
- }
-----
-
-NOTE: A `@Timed` annotation with `longTask = true` will enable a long task timer for the method.
-Long task timers require a separate metric name, and can be stacked with a short task timer.
-
-
-
-[[actuator.metrics.registering-custom]]
-=== Registering Custom Metrics
-To register custom metrics, inject `MeterRegistry` into your component, as shown in the following example:
-
-[source,java,indent=0]
-----
-include::{include-productionreadyfeatures}/metrics/MetricsMeterRegistryInjection.java[tag=*]
-----
-
-If your metrics depend on other beans, it is recommended that you use a `MeterBinder` to register them, as shown in the following example:
-
-[source,java,indent=0]
-----
-include::{include-productionreadyfeatures}/metrics/SampleMeterBinderConfiguration.java[tag=*]
-----
-
-Using a `MeterBinder` ensures that the correct dependency relationships are set up and that the bean is available when the metric's value is retrieved.
-A `MeterBinder` implementation can also be useful if you find that you repeatedly instrument a suite of metrics across components or applications.
-
-NOTE: By default, metrics from all `MeterBinder` beans will be automatically bound to the Spring-managed `MeterRegistry`.
-
-
-
-[[actuator.metrics.customizing]]
-=== Customizing Individual Metrics
-If you need to apply customizations to specific `Meter` instances you can use the `io.micrometer.core.instrument.config.MeterFilter` interface.
-
-For example, if you want to rename the `mytag.region` tag to `mytag.area` for all meter IDs beginning with `com.example`, you can do the following:
-
-[source,java,indent=0]
-----
-include::{include-productionreadyfeatures}/metrics/MetricsFilterConfiguration.java[tag=*]
-----
-
-NOTE: By default, all `MeterFilter` beans will be automatically bound to the Spring-managed `MeterRegistry`.
-Make sure to register your metrics using the Spring-managed `MeterRegistry` and not any of the static methods on `Metrics`.
-These use the global registry that is not Spring-managed.
-
-
-
-[[actuator.metrics.customizing.common-tags]]
-==== Common Tags
-Common tags are generally used for dimensional drill-down on the operating environment like host, instance, region, stack, etc.
-Commons tags are applied to all meters and can be configured as shown in the following example:
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- tags:
- region: "us-east-1"
- stack: "prod"
-----
-
-The example above adds `region` and `stack` tags to all meters with a value of `us-east-1` and `prod` respectively.
-
-NOTE: The order of common tags is important if you are using Graphite.
-As the order of common tags cannot be guaranteed using this approach, Graphite users are advised to define a custom `MeterFilter` instead.
-
-
-
-[[actuator.metrics.customizing.per-meter-properties]]
-==== Per-meter Properties
-In addition to `MeterFilter` beans, it's also possible to apply a limited set of customization on a per-meter basis using properties.
-Per-meter customizations apply to any all meter IDs that start with the given name.
-For example, the following will disable any meters that have an ID starting with `example.remote`
-
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- metrics:
- enable:
- example:
- remote: false
-----
-
-The following properties allow per-meter customization:
-
-.Per-meter customizations
-|===
-| Property | Description
-
-| configprop:management.metrics.enable[]
-| Whether to deny meters from emitting any metrics.
-
-| configprop:management.metrics.distribution.percentiles-histogram[]
-| Whether to publish a histogram suitable for computing aggregable (across dimension) percentile approximations.
-
-| configprop:management.metrics.distribution.minimum-expected-value[], configprop:management.metrics.distribution.maximum-expected-value[]
-| Publish less histogram buckets by clamping the range of expected values.
-
-| configprop:management.metrics.distribution.percentiles[]
-| Publish percentile values computed in your application
-
-| configprop:management.metrics.distribution.slo[]
-| Publish a cumulative histogram with buckets defined by your service-level objectives.
-|===
-
-For more details on concepts behind `percentiles-histogram`, `percentiles` and `slo` refer to the {micrometer-concepts-docs}#_histograms_and_percentiles["Histograms and percentiles" section] of the micrometer documentation.
-
-
-
-[[actuator.metrics.endpoint]]
-=== Metrics Endpoint
-Spring Boot provides a `metrics` endpoint that can be used diagnostically to examine the metrics collected by an application.
-The endpoint is not available by default and must be exposed, see <> for more details.
-
-Navigating to `/actuator/metrics` displays a list of available meter names.
-You can drill down to view information about a particular meter by providing its name as a selector, e.g. `/actuator/metrics/jvm.memory.max`.
-
-[TIP]
-====
-The name you use here should match the name used in the code, not the name after it has been naming-convention normalized for a monitoring system it is shipped to.
-In other words, if `jvm.memory.max` appears as `jvm_memory_max` in Prometheus because of its snake case naming convention, you should still use `jvm.memory.max` as the selector when inspecting the meter in the `metrics` endpoint.
-====
-
-You can also add any number of `tag=KEY:VALUE` query parameters to the end of the URL to dimensionally drill down on a meter, e.g. `/actuator/metrics/jvm.memory.max?tag=area:nonheap`.
-
-[TIP]
-====
-The reported measurements are the _sum_ of the statistics of all meters matching the meter name and any tags that have been applied.
-So in the example above, the returned "Value" statistic is the sum of the maximum memory footprints of "Code Cache", "Compressed Class Space", and "Metaspace" areas of the heap.
-If you only wanted to see the maximum size for the "Metaspace", you could add an additional `tag=id:Metaspace`, i.e. `/actuator/metrics/jvm.memory.max?tag=area:nonheap&tag=id:Metaspace`.
-====
-
-
-
-[[actuator.auditing]]
-== Auditing
-Once Spring Security is in play, Spring Boot Actuator has a flexible audit framework that publishes events (by default, "`authentication success`", "`failure`" and "`access denied`" exceptions).
-This feature can be very useful for reporting and for implementing a lock-out policy based on authentication failures.
-
-Auditing can be enabled by providing a bean of type `AuditEventRepository` in your application's configuration.
-For convenience, Spring Boot offers an `InMemoryAuditEventRepository`.
-`InMemoryAuditEventRepository` has limited capabilities and we recommend using it only for development environments.
-For production environments, consider creating your own alternative `AuditEventRepository` implementation.
-
-
-
-[[actuator.auditing.custom]]
-=== Custom Auditing
-To customize published security events, you can provide your own implementations of `AbstractAuthenticationAuditListener` and `AbstractAuthorizationAuditListener`.
-
-You can also use the audit services for your own business events.
-To do so, either inject the `AuditEventRepository` bean into your own components and use that directly or publish an `AuditApplicationEvent` with the Spring `ApplicationEventPublisher` (by implementing `ApplicationEventPublisherAware`).
-
-
-
-[[actuator.tracing]]
-== HTTP Tracing
-HTTP Tracing can be enabled by providing a bean of type `HttpTraceRepository` in your application's configuration.
-For convenience, Spring Boot offers an `InMemoryHttpTraceRepository` that stores traces for the last 100 request-response exchanges, by default.
-`InMemoryHttpTraceRepository` is limited compared to other tracing solutions and we recommend using it only for development environments.
-For production environments, use of a production-ready tracing or observability solution, such as Zipkin or Spring Cloud Sleuth, is recommended.
-Alternatively, create your own `HttpTraceRepository` that meets your needs.
-
-The `httptrace` endpoint can be used to obtain information about the request-response exchanges that are stored in the `HttpTraceRepository`.
-
-
-
-[[actuator.tracing.custom]]
-=== Custom HTTP tracing
-To customize the items that are included in each trace, use the configprop:management.trace.http.include[] configuration property.
-For advanced customization, consider registering your own `HttpExchangeTracer` implementation.
-
-
-
-[[actuator.process-monitoring]]
-== Process Monitoring
-In the `spring-boot` module, you can find two classes to create files that are often useful for process monitoring:
-
-* `ApplicationPidFileWriter` creates a file containing the application PID (by default, in the application directory with a file name of `application.pid`).
-* `WebServerPortFileWriter` creates a file (or files) containing the ports of the running web server (by default, in the application directory with a file name of `application.port`).
-
-By default, these writers are not activated, but you can enable:
-
-* <>
-* <>
-
-
-
-[[actuator.process-monitoring.configuration]]
-=== Extending Configuration
-In the `META-INF/spring.factories` file, you can activate the listener(s) that writes a PID file, as shown in the following example:
-
-[indent=0]
-----
- org.springframework.context.ApplicationListener=\
- org.springframework.boot.context.ApplicationPidFileWriter,\
- org.springframework.boot.web.context.WebServerPortFileWriter
-----
-
-
-
-[[actuator.process-monitoring.programmatically]]
-=== Programmatically
-You can also activate a listener by invoking the `SpringApplication.addListeners(...)` method and passing the appropriate `Writer` object.
-This method also lets you customize the file name and path in the `Writer` constructor.
-
-
-
-[[actuator.cloud-foundry]]
-== Cloud Foundry Support
-Spring Boot's actuator module includes additional support that is activated when you deploy to a compatible Cloud Foundry instance.
-The `/cloudfoundryapplication` path provides an alternative secured route to all `@Endpoint` beans.
-
-The extended support lets Cloud Foundry management UIs (such as the web application that you can use to view deployed applications) be augmented with Spring Boot actuator information.
-For example, an application status page may include full health information instead of the typical "`running`" or "`stopped`" status.
-
-NOTE: The `/cloudfoundryapplication` path is not directly accessible to regular users.
-In order to use the endpoint, a valid UAA token must be passed with the request.
-
-
-
-[[actuator.cloud-foundry.disable]]
-=== Disabling Extended Cloud Foundry Actuator Support
-If you want to fully disable the `/cloudfoundryapplication` endpoints, you can add the following setting to your `application.properties` file:
-
-
-.application.properties
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- cloudfoundry:
- enabled: false
-----
-
-
-
-[[actuator.cloud-foundry.ssl]]
-=== Cloud Foundry Self-signed Certificates
-By default, the security verification for `/cloudfoundryapplication` endpoints makes SSL calls to various Cloud Foundry services.
-If your Cloud Foundry UAA or Cloud Controller services use self-signed certificates, you need to set the following property:
-
-.application.properties
-[source,yaml,indent=0,configprops,configblocks]
-----
- management:
- cloudfoundry:
- skip-ssl-validation: true
-----
-
-
-
-[[actuator.cloud-foundry.custom-context-path]]
-=== Custom Context Path
-If the server's context-path has been configured to anything other than `/`, the Cloud Foundry endpoints will not be available at the root of the application.
-For example, if `server.servlet.context-path=/app`, Cloud Foundry endpoints will be available at `/app/cloudfoundryapplication/*`.
-
-If you expect the Cloud Foundry endpoints to always be available at `/cloudfoundryapplication/*`, regardless of the server's context-path, you will need to explicitly configure that in your application.
-The configuration will differ depending on the web server in use.
-For Tomcat, the following configuration can be added:
-
-[source,java,indent=0]
-----
-include::{include-productionreadyfeatures}/cloudfoundry/CloudFoundryCustomContextPathConfiguration.java[tag=*]
-----
-
-
-
-[[actuator.whats-next]]
-== What to Read Next
-You might want to read about graphing tools such as https://graphiteapp.org[Graphite].
-
-Otherwise, you can continue on, to read about <> or jump ahead for some in-depth information about Spring Boot's _<>_.
+include::actuator/whats-next.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/auditing.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/auditing.adoc
new file mode 100644
index 0000000000..2a18952ed1
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/auditing.adoc
@@ -0,0 +1,18 @@
+[[actuator.auditing]]
+== Auditing
+Once Spring Security is in play, Spring Boot Actuator has a flexible audit framework that publishes events (by default, "`authentication success`", "`failure`" and "`access denied`" exceptions).
+This feature can be very useful for reporting and for implementing a lock-out policy based on authentication failures.
+
+Auditing can be enabled by providing a bean of type `AuditEventRepository` in your application's configuration.
+For convenience, Spring Boot offers an `InMemoryAuditEventRepository`.
+`InMemoryAuditEventRepository` has limited capabilities and we recommend using it only for development environments.
+For production environments, consider creating your own alternative `AuditEventRepository` implementation.
+
+
+
+[[actuator.auditing.custom]]
+=== Custom Auditing
+To customize published security events, you can provide your own implementations of `AbstractAuthenticationAuditListener` and `AbstractAuthorizationAuditListener`.
+
+You can also use the audit services for your own business events.
+To do so, either inject the `AuditEventRepository` bean into your own components and use that directly or publish an `AuditApplicationEvent` with the Spring `ApplicationEventPublisher` (by implementing `ApplicationEventPublisherAware`).
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/cloud-foundry.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/cloud-foundry.adoc
new file mode 100644
index 0000000000..d4028b1ce9
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/cloud-foundry.adoc
@@ -0,0 +1,56 @@
+[[actuator.cloud-foundry]]
+== Cloud Foundry Support
+Spring Boot's actuator module includes additional support that is activated when you deploy to a compatible Cloud Foundry instance.
+The `/cloudfoundryapplication` path provides an alternative secured route to all `@Endpoint` beans.
+
+The extended support lets Cloud Foundry management UIs (such as the web application that you can use to view deployed applications) be augmented with Spring Boot actuator information.
+For example, an application status page may include full health information instead of the typical "`running`" or "`stopped`" status.
+
+NOTE: The `/cloudfoundryapplication` path is not directly accessible to regular users.
+In order to use the endpoint, a valid UAA token must be passed with the request.
+
+
+
+[[actuator.cloud-foundry.disable]]
+=== Disabling Extended Cloud Foundry Actuator Support
+If you want to fully disable the `/cloudfoundryapplication` endpoints, you can add the following setting to your `application.properties` file:
+
+
+.application.properties
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ cloudfoundry:
+ enabled: false
+----
+
+
+
+[[actuator.cloud-foundry.ssl]]
+=== Cloud Foundry Self-signed Certificates
+By default, the security verification for `/cloudfoundryapplication` endpoints makes SSL calls to various Cloud Foundry services.
+If your Cloud Foundry UAA or Cloud Controller services use self-signed certificates, you need to set the following property:
+
+.application.properties
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ cloudfoundry:
+ skip-ssl-validation: true
+----
+
+
+
+[[actuator.cloud-foundry.custom-context-path]]
+=== Custom Context Path
+If the server's context-path has been configured to anything other than `/`, the Cloud Foundry endpoints will not be available at the root of the application.
+For example, if `server.servlet.context-path=/app`, Cloud Foundry endpoints will be available at `/app/cloudfoundryapplication/*`.
+
+If you expect the Cloud Foundry endpoints to always be available at `/cloudfoundryapplication/*`, regardless of the server's context-path, you will need to explicitly configure that in your application.
+The configuration will differ depending on the web server in use.
+For Tomcat, the following configuration can be added:
+
+[source,java,indent=0]
+----
+include::{include-productionreadyfeatures}/cloudfoundry/CloudFoundryCustomContextPathConfiguration.java[tag=*]
+----
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/enabling.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/enabling.adoc
new file mode 100644
index 0000000000..f8162750f7
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/enabling.adoc
@@ -0,0 +1,31 @@
+[[actuator.enabling]]
+== Enabling 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 recommended way to enable the features is to add a dependency on the `spring-boot-starter-actuator` '`Starter`'.
+
+.Definition of Actuator
+****
+An actuator is a manufacturing term that refers to a mechanical device for moving or controlling something.
+Actuators can generate a large amount of motion from a small change.
+****
+
+To add the actuator to a Maven based project, add the following '`Starter`' dependency:
+
+[source,xml,indent=0]
+----
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+----
+
+For Gradle, use the following declaration:
+
+[source,groovy,indent=0]
+----
+ dependencies {
+ implementation 'org.springframework.boot:spring-boot-starter-actuator'
+ }
+----
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc
new file mode 100644
index 0000000000..9cd28a92c1
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc
@@ -0,0 +1,1250 @@
+[[actuator.endpoints]]
+== Endpoints
+Actuator endpoints let you monitor and interact with your application.
+Spring Boot includes a number of built-in endpoints and lets you add your own.
+For example, the `health` endpoint provides basic application health information.
+
+Each individual endpoint can be <> and <>.
+An endpoint is considered to be available when it is both enabled and exposed.
+The built-in endpoints will only be auto-configured when they are available.
+Most applications choose exposure via HTTP, where the ID of the endpoint along with a prefix of `/actuator` is mapped to a URL.
+For example, by default, the `health` endpoint is mapped to `/actuator/health`.
+
+TIP: 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-docs}[HTML] or {spring-boot-actuator-restapi-pdfdocs}[PDF]).
+
+The following technology-agnostic endpoints are available:
+
+[cols="2,5"]
+|===
+| ID | Description
+
+| `auditevents`
+| Exposes audit events information for the current application.
+ Requires an `AuditEventRepository` bean.
+
+| `beans`
+| Displays a complete list of all the Spring beans in your application.
+
+| `caches`
+| Exposes available caches.
+
+| `conditions`
+| Shows the conditions that were evaluated on configuration and auto-configuration classes and the reasons why they did or did not match.
+
+| `configprops`
+| Displays a collated list of all `@ConfigurationProperties`.
+
+| `env`
+| Exposes properties from Spring's `ConfigurableEnvironment`.
+
+| `flyway`
+| Shows any Flyway database migrations that have been applied.
+ Requires one or more `Flyway` beans.
+
+| `health`
+| Shows application health information.
+
+| `httptrace`
+| Displays HTTP trace information (by default, the last 100 HTTP request-response exchanges).
+ Requires an `HttpTraceRepository` bean.
+
+| `info`
+| Displays arbitrary application info.
+
+| `integrationgraph`
+| Shows the Spring Integration graph.
+ Requires a dependency on `spring-integration-core`.
+
+| `loggers`
+| Shows and modifies the configuration of loggers in the application.
+
+| `liquibase`
+| Shows any Liquibase database migrations that have been applied.
+ Requires one or more `Liquibase` beans.
+
+| `metrics`
+| Shows '`metrics`' information for the current application.
+
+| `mappings`
+| Displays a collated list of all `@RequestMapping` paths.
+
+|`quartz`
+|Shows information about Quartz Scheduler jobs.
+
+| `scheduledtasks`
+| Displays the scheduled tasks in your application.
+
+| `sessions`
+| Allows retrieval and deletion of user sessions from a Spring Session-backed session store.
+ Requires a Servlet-based web application using Spring Session.
+
+| `shutdown`
+| Lets the application be gracefully shutdown.
+ Disabled by default.
+
+| `startup`
+| Shows the <> collected by the `ApplicationStartup`.
+ Requires the `SpringApplication` to be configured with a `BufferingApplicationStartup`.
+
+| `threaddump`
+| Performs a thread dump.
+|===
+
+If your application is a web application (Spring MVC, Spring WebFlux, or Jersey), you can use the following additional endpoints:
+
+[cols="2,5"]
+|===
+| ID | Description
+
+| `heapdump`
+| Returns an `hprof` heap dump file.
+
+| `jolokia`
+| Exposes JMX beans over HTTP (when Jolokia is on the classpath, not available for WebFlux).
+ Requires a dependency on `jolokia-core`.
+
+| `logfile`
+| Returns the contents of the logfile (if `logging.file.name` or `logging.file.path` properties have been set).
+ Supports the use of the HTTP `Range` header to retrieve part of the log file's content.
+
+| `prometheus`
+| Exposes metrics in a format that can be scraped by a Prometheus server.
+ Requires a dependency on `micrometer-registry-prometheus`.
+|===
+
+
+
+[[actuator.endpoints.enabling]]
+=== Enabling Endpoints
+By default, all endpoints except for `shutdown` are enabled.
+To configure the enablement of an endpoint, use its `management.endpoint..enabled` property.
+The following example enables the `shutdown` endpoint:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoint:
+ shutdown:
+ enabled: true
+----
+
+If you prefer endpoint enablement to be opt-in rather than opt-out, set the configprop:management.endpoints.enabled-by-default[] property to `false` and use individual endpoint `enabled` properties to opt back in.
+The following example enables the `info` endpoint and disables all other endpoints:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoints:
+ enabled-by-default: false
+ endpoint:
+ info:
+ enabled: true
+----
+
+NOTE: Disabled endpoints are removed entirely from the application context.
+If you want to change only the technologies over which an endpoint is exposed, use the <> instead.
+
+
+
+[[actuator.endpoints.exposing]]
+=== Exposing Endpoints
+Since Endpoints may contain sensitive information, careful consideration should be given about when to expose them.
+The following table shows the default exposure for the built-in endpoints:
+
+[cols="1,1,1"]
+|===
+| ID | JMX | Web
+
+| `auditevents`
+| Yes
+| No
+
+| `beans`
+| Yes
+| No
+
+| `caches`
+| Yes
+| No
+
+| `conditions`
+| Yes
+| No
+
+| `configprops`
+| Yes
+| No
+
+| `env`
+| Yes
+| No
+
+| `flyway`
+| Yes
+| No
+
+| `health`
+| Yes
+| Yes
+
+| `heapdump`
+| N/A
+| No
+
+| `httptrace`
+| Yes
+| No
+
+| `info`
+| Yes
+| Yes
+
+| `integrationgraph`
+| Yes
+| No
+
+| `jolokia`
+| N/A
+| No
+
+| `logfile`
+| N/A
+| No
+
+| `loggers`
+| Yes
+| No
+
+| `liquibase`
+| Yes
+| No
+
+| `metrics`
+| Yes
+| No
+
+| `mappings`
+| Yes
+| No
+
+| `prometheus`
+| N/A
+| No
+
+| `quartz`
+| Yes
+| No
+
+| `scheduledtasks`
+| Yes
+| No
+
+| `sessions`
+| Yes
+| No
+
+| `shutdown`
+| Yes
+| No
+
+| `startup`
+| Yes
+| No
+
+| `threaddump`
+| Yes
+| No
+|===
+
+To change which endpoints are exposed, use the following technology-specific `include` and `exclude` properties:
+
+[cols="3,1"]
+|===
+| Property | Default
+
+| configprop:management.endpoints.jmx.exposure.exclude[]
+|
+
+| configprop:management.endpoints.jmx.exposure.include[]
+| `*`
+
+| configprop:management.endpoints.web.exposure.exclude[]
+|
+
+| configprop:management.endpoints.web.exposure.include[]
+| `info, health`
+|===
+
+The `include` property lists the IDs of the endpoints that are exposed.
+The `exclude` property lists the IDs of the endpoints that should not be exposed.
+The `exclude` property takes precedence over the `include` property.
+Both `include` and `exclude` properties can be configured with a list of endpoint IDs.
+
+For example, to stop exposing all endpoints over JMX and only expose the `health` and `info` endpoints, use the following property:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoints:
+ jmx:
+ exposure:
+ include: "health,info"
+----
+
+`*` can be used to select all endpoints.
+For example, to expose everything over HTTP except the `env` and `beans` endpoints, use the following properties:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoints:
+ web:
+ exposure:
+ include: "*"
+ exclude: "env,beans"
+----
+
+NOTE: `*` has a special meaning in YAML, so be sure to add quotes if you want to include (or exclude) all endpoints.
+
+NOTE: If your application is exposed publicly, we strongly recommend that you also <>.
+
+TIP: If you want to implement your own strategy for when endpoints are exposed, you can register an `EndpointFilter` bean.
+
+
+
+[[actuator.endpoints.security]]
+=== Securing HTTP Endpoints
+You should take care to secure HTTP endpoints in the same way that you would any other sensitive URL.
+If Spring Security is present, endpoints are secured by default using Spring Security’s content-negotiation strategy.
+If you wish to configure custom security for HTTP endpoints, for example, only allow users with a certain role to access them, Spring Boot provides some convenient `RequestMatcher` objects that can be used in combination with Spring Security.
+
+A typical Spring Security configuration might look something like the following example:
+
+[source,java,pending-extract=true,indent=0]
+----
+ @Bean
+ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
+ http.requestMatcher(EndpointRequest.toAnyEndpoint()).authorizeRequests((requests) ->
+ requests.anyRequest().hasRole("ENDPOINT_ADMIN"));
+ http.httpBasic();
+ return http.build();
+ }
+----
+
+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-restapi-docs}[HTML] or {spring-boot-actuator-restapi-pdfdocs}[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 configprop:management.endpoints.web.exposure.include[] property, as follows:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoints:
+ web:
+ exposure:
+ include: "*"
+----
+
+Additionally, if Spring Security is present, you would need to add custom security configuration that allows unauthenticated access to the endpoints as shown in the following example:
+
+[source,java,pending-extract=true,indent=0]
+----
+ @Bean
+ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
+ http.requestMatcher(EndpointRequest.toAnyEndpoint()).authorizeRequests((requests) ->
+ requests.anyRequest().permitAll());
+ return http.build();
+ }
+----
+
+NOTE: In both the examples above, the configuration applies only to the actuator endpoints.
+Since Spring Boot's security configuration backs off completely in the presence of any `SecurityFilterChain` bean, you will need to configure an additional `SecurityFilterChain` bean with rules that apply to the rest of the application.
+
+
+
+[[actuator.endpoints.caching]]
+=== Configuring Endpoints
+Endpoints automatically cache responses to read operations that do not take any parameters.
+To configure the amount of time for which an endpoint will cache a response, use its `cache.time-to-live` property.
+The following example sets the time-to-live of the `beans` endpoint's cache to 10 seconds:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoint:
+ beans:
+ cache:
+ time-to-live: "10s"
+----
+
+NOTE: The prefix `management.endpoint.` is used to uniquely identify the endpoint that is being configured.
+
+
+
+[[actuator.endpoints.hypermedia]]
+=== Hypermedia for Actuator Web Endpoints
+A "`discovery page`" is added with links to all the endpoints.
+The "`discovery page`" is available on `/actuator` by default.
+
+To disable the "`discovery page`", add the following property to your application properties:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoints:
+ web:
+ discovery:
+ enabled: false
+----
+
+When a custom management context path is configured, the "`discovery page`" automatically moves from `/actuator` to the root of the management context.
+For example, if the management context path is `/management`, then the discovery page is available from `/management`.
+When the management context path is set to `/`, the discovery page is disabled to prevent the possibility of a clash with other mappings.
+
+
+
+[[actuator.endpoints.cors]]
+=== 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] that lets you specify in a flexible way what kind of cross-domain requests are authorized.
+If you use Spring MVC or Spring WebFlux, Actuator's web endpoints can be configured to support such scenarios.
+
+CORS support is disabled by default and is only enabled once the configprop:management.endpoints.web.cors.allowed-origins[] property has been set.
+The following configuration permits `GET` and `POST` calls from the `example.com` domain:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoints:
+ web:
+ cors:
+ allowed-origins: "https://example.com"
+ allowed-methods: "GET,POST"
+----
+
+TIP: See {spring-boot-actuator-autoconfigure-module-code}/endpoint/web/CorsEndpointProperties.java[CorsEndpointProperties] for a complete list of options.
+
+
+
+[[actuator.endpoints.implementing-custom]]
+=== Implementing Custom Endpoints
+If you add a `@Bean` annotated with `@Endpoint`, any methods annotated with `@ReadOperation`, `@WriteOperation`, or `@DeleteOperation` are automatically exposed over JMX and, in a web application, over HTTP as well.
+Endpoints can be exposed over HTTP using Jersey, Spring MVC, or Spring WebFlux.
+If both Jersey and Spring MVC are available, Spring MVC will be used.
+
+The following example exposes a read operation that returns a custom object:
+
+[source,java,indent=0]
+----
+include::{include-productionreadyfeatures}/endpoints/CustomEndpoint.java[tag=read]
+----
+
+You can also write technology-specific endpoints by using `@JmxEndpoint` or `@WebEndpoint`.
+These endpoints are restricted to their respective technologies.
+For example, `@WebEndpoint` is exposed only over HTTP and not over JMX.
+
+You can write technology-specific extensions by using `@EndpointWebExtension` and `@EndpointJmxExtension`.
+These annotations let you provide technology-specific operations to augment an existing endpoint.
+
+Finally, if you need access to web-framework-specific functionality, you can implement Servlet or Spring `@Controller` and `@RestController` endpoints at the cost of them not being available over JMX or when using a different web framework.
+
+
+
+[[actuator.endpoints.implementing-custom.input]]
+==== Receiving Input
+Operations on an endpoint receive input via their parameters.
+When exposed via the web, the values for these parameters are taken from the URL's query parameters and from the JSON request body.
+When exposed via JMX, the parameters are mapped to the parameters of the MBean's operations.
+Parameters are required by default.
+They can be made optional by annotating them with either `@javax.annotation.Nullable` or `@org.springframework.lang.Nullable`.
+
+Each root property in the JSON request body can be mapped to a parameter of the endpoint.
+Consider the following JSON request body:
+
+[source,json,indent=0]
+----
+ {
+ "name": "test",
+ "counter": 42
+ }
+----
+
+This can be used to invoke a write operation that takes `String name` and `int counter` parameters, as shown in the following example:
+
+[source,java,indent=0]
+----
+include::{include-productionreadyfeatures}/endpoints/CustomEndpoint.java[tag=write]
+----
+
+TIP: Because endpoints are technology agnostic, only simple types can be specified in the method signature.
+In particular declaring a single parameter with a `CustomData` type defining a `name` and `counter` properties is not supported.
+
+NOTE: To allow the input to be mapped to the operation method's parameters, Java code implementing an endpoint should be compiled with `-parameters`, and Kotlin code implementing an endpoint should be compiled with `-java-parameters`.
+This will happen automatically if you are using Spring Boot's Gradle plugin or if you are using Maven and `spring-boot-starter-parent`.
+
+
+
+[[actuator.endpoints.implementing-custom.input.conversion]]
+===== Input Type Conversion
+The parameters passed to endpoint operation methods are, if necessary, automatically converted to the required type.
+Before calling an operation method, the input received via JMX or an HTTP request is converted to the required types using an instance of `ApplicationConversionService` as well as any `Converter` or `GenericConverter` beans qualified with `@EndpointConverter`.
+
+
+
+[[actuator.endpoints.implementing-custom.web]]
+==== Custom Web Endpoints
+Operations on an `@Endpoint`, `@WebEndpoint`, or `@EndpointWebExtension` are automatically exposed over HTTP using Jersey, Spring MVC, or Spring WebFlux.
+If both Jersey and Spring MVC are available, Spring MVC will be used.
+
+
+
+[[actuator.endpoints.implementing-custom.web.request-predicates]]
+===== Web Endpoint Request Predicates
+A request predicate is automatically generated for each operation on a web-exposed endpoint.
+
+
+
+[[actuator.endpoints.implementing-custom.web.path-predicates]]
+===== Path
+The path of the predicate is determined by the ID of the endpoint and the base path of web-exposed endpoints.
+The default base path is `/actuator`.
+For example, an endpoint with the ID `sessions` will use `/actuator/sessions` as its path in the predicate.
+
+The path can be further customized by annotating one or more parameters of the operation method with `@Selector`.
+Such a parameter is added to the path predicate as a path variable.
+The variable's value is passed into the operation method when the endpoint operation is invoked.
+If you want to capture all remaining path elements, you can add `@Selector(Match=ALL_REMAINING)` to the last parameter and make it a type that is conversion compatible with a `String[]`.
+
+
+
+[[actuator.endpoints.implementing-custom.web.method-predicates]]
+===== HTTP method
+The HTTP method of the predicate is determined by the operation type, as shown in the following table:
+
+[cols="3, 1"]
+|===
+| Operation | HTTP method
+
+| `@ReadOperation`
+| `GET`
+
+| `@WriteOperation`
+| `POST`
+
+| `@DeleteOperation`
+| `DELETE`
+|===
+
+
+
+[[actuator.endpoints.implementing-custom.web.consumes-predicates]]
+===== Consumes
+For a `@WriteOperation` (HTTP `POST`) that uses the request body, the consumes clause of the predicate is `application/vnd.spring-boot.actuator.v2+json, application/json`.
+For all other operations the consumes clause is empty.
+
+
+
+[[actuator.endpoints.implementing-custom.web.produces-predicates]]
+===== Produces
+The produces clause of the predicate can be determined by the `produces` attribute of the `@DeleteOperation`, `@ReadOperation`, and `@WriteOperation` annotations.
+The attribute is optional.
+If it is not used, the produces clause is determined automatically.
+
+If the operation method returns `void` or `Void` the produces clause is empty.
+If the operation method returns a `org.springframework.core.io.Resource`, the produces clause is `application/octet-stream`.
+For all other operations the produces clause is `application/vnd.spring-boot.actuator.v2+json, application/json`.
+
+
+
+[[actuator.endpoints.implementing-custom.web.response-status]]
+===== Web Endpoint Response Status
+The default response status for an endpoint operation depends on the operation type (read, write, or delete) and what, if anything, the operation returns.
+
+A `@ReadOperation` returns a value, the response status will be 200 (OK).
+If it does not return a value, the response status will be 404 (Not Found).
+
+If a `@WriteOperation` or `@DeleteOperation` returns a value, the response status will be 200 (OK).
+If it does not return a value the response status will be 204 (No Content).
+
+If an operation is invoked without a required parameter, or with a parameter that cannot be converted to the required type, the operation method will not be called and the response status will be 400 (Bad Request).
+
+
+
+[[actuator.endpoints.implementing-custom.web.range-requests]]
+===== Web Endpoint Range Requests
+An HTTP range request can be used to request part of an HTTP resource.
+When using Spring MVC or Spring Web Flux, operations that return a `org.springframework.core.io.Resource` automatically support range requests.
+
+NOTE: Range requests are not supported when using Jersey.
+
+
+
+[[actuator.endpoints.implementing-custom.web.security]]
+===== Web Endpoint Security
+An operation on a web endpoint or a web-specific endpoint extension can receive the current `java.security.Principal` or `org.springframework.boot.actuate.endpoint.SecurityContext` as a method parameter.
+The former is typically used in conjunction with `@Nullable` to provide different behavior for authenticated and unauthenticated users.
+The latter is typically used to perform authorization checks using its `isUserInRole(String)` method.
+
+
+
+[[actuator.endpoints.implementing-custom.servlet]]
+==== Servlet Endpoints
+A `Servlet` can be exposed as an endpoint by implementing a class annotated with `@ServletEndpoint` that also implements `Supplier`.
+Servlet endpoints provide deeper integration with the Servlet container but at the expense of portability.
+They are intended to be used to expose an existing `Servlet` as an endpoint.
+For new endpoints, the `@Endpoint` and `@WebEndpoint` annotations should be preferred whenever possible.
+
+
+
+[[actuator.endpoints.implementing-custom.controller]]
+==== Controller Endpoints
+`@ControllerEndpoint` and `@RestControllerEndpoint` can be used to implement an endpoint that is only exposed by Spring MVC or Spring WebFlux.
+Methods are mapped using the standard annotations for Spring MVC and Spring WebFlux such as `@RequestMapping` and `@GetMapping`, with the endpoint's ID being used as a prefix for the path.
+Controller endpoints provide deeper integration with Spring's web frameworks but at the expense of portability.
+The `@Endpoint` and `@WebEndpoint` annotations should be preferred whenever possible.
+
+
+
+[[actuator.endpoints.health]]
+=== Health Information
+You can use health information to check the status of your running application.
+It is often used by monitoring software to alert someone when a production system goes down.
+The information exposed by the `health` endpoint depends on the configprop:management.endpoint.health.show-details[] and configprop:management.endpoint.health.show-components[] properties which can be configured with one of the following values:
+
+[cols="1, 3"]
+|===
+| Name | Description
+
+| `never`
+| Details are never shown.
+
+| `when-authorized`
+| Details are only shown to authorized users.
+ Authorized roles can be configured using `management.endpoint.health.roles`.
+
+| `always`
+| Details are shown to all users.
+|===
+
+The default value is `never`.
+A user is considered to be authorized when they are in one or more of the endpoint's roles.
+If the endpoint has no configured roles (the default) all authenticated users are considered to be authorized.
+The roles can be configured using the configprop:management.endpoint.health.roles[] property.
+
+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 {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`.
+A `HealthIndicator` provides actual health information, including a `Status`.
+A `CompositeHealthContributor` provides a composite of other `HealthContributors`.
+Taken together, contributors form a tree structure to represent the overall system health.
+
+By default, the final system health is derived by a `StatusAggregator` which sorts the statuses from each `HealthIndicator` based on an ordered list of statuses.
+The first status in the sorted list is used as the overall health status.
+If no `HealthIndicator` returns a status that is known to the `StatusAggregator`, an `UNKNOWN` status is used.
+
+TIP: The `HealthContributorRegistry` can be used to register and unregister health indicators at runtime.
+
+
+
+[[actuator.endpoints.health.auto-configured-health-indicators]]
+==== Auto-configured HealthIndicators
+The following `HealthIndicators` are auto-configured by Spring Boot when appropriate.
+You can also enable/disable selected indicators by configuring `management.health.key.enabled`,
+with the `key` listed in the table below.
+
+[cols="2,4,6"]
+|===
+| Key | Name | Description
+
+| `cassandra`
+| {spring-boot-actuator-module-code}/cassandra/CassandraDriverHealthIndicator.java[`CassandraDriverHealthIndicator`]
+| Checks that a Cassandra database is up.
+
+| `couchbase`
+| {spring-boot-actuator-module-code}/couchbase/CouchbaseHealthIndicator.java[`CouchbaseHealthIndicator`]
+| Checks that a Couchbase cluster is up.
+
+| `db`
+| {spring-boot-actuator-module-code}/jdbc/DataSourceHealthIndicator.java[`DataSourceHealthIndicator`]
+| Checks that a connection to `DataSource` can be obtained.
+
+| `diskspace`
+| {spring-boot-actuator-module-code}/system/DiskSpaceHealthIndicator.java[`DiskSpaceHealthIndicator`]
+| Checks for low disk space.
+
+| `elasticsearch`
+| {spring-boot-actuator-module-code}/elasticsearch/ElasticsearchRestHealthIndicator.java[`ElasticsearchRestHealthIndicator`]
+| Checks that an Elasticsearch cluster is up.
+
+| `hazelcast`
+| {spring-boot-actuator-module-code}/hazelcast/HazelcastHealthIndicator.java[`HazelcastHealthIndicator`]
+| Checks that a Hazelcast server is up.
+
+| `influxdb`
+| {spring-boot-actuator-module-code}/influx/InfluxDbHealthIndicator.java[`InfluxDbHealthIndicator`]
+| Checks that an InfluxDB server is up.
+
+| `jms`
+| {spring-boot-actuator-module-code}/jms/JmsHealthIndicator.java[`JmsHealthIndicator`]
+| Checks that a JMS broker is up.
+
+| `ldap`
+| {spring-boot-actuator-module-code}/ldap/LdapHealthIndicator.java[`LdapHealthIndicator`]
+| Checks that an LDAP server is up.
+
+| `mail`
+| {spring-boot-actuator-module-code}/mail/MailHealthIndicator.java[`MailHealthIndicator`]
+| Checks that a mail server is up.
+
+| `mongo`
+| {spring-boot-actuator-module-code}/mongo/MongoHealthIndicator.java[`MongoHealthIndicator`]
+| Checks that a Mongo database is up.
+
+| `neo4j`
+| {spring-boot-actuator-module-code}/neo4j/Neo4jHealthIndicator.java[`Neo4jHealthIndicator`]
+| Checks that a Neo4j database is up.
+
+| `ping`
+| {spring-boot-actuator-module-code}/health/PingHealthIndicator.java[`PingHealthIndicator`]
+| Always responds with `UP`.
+
+| `rabbit`
+| {spring-boot-actuator-module-code}/amqp/RabbitHealthIndicator.java[`RabbitHealthIndicator`]
+| Checks that a Rabbit server is up.
+
+| `redis`
+| {spring-boot-actuator-module-code}/redis/RedisHealthIndicator.java[`RedisHealthIndicator`]
+| Checks that a Redis server is up.
+
+| `solr`
+| {spring-boot-actuator-module-code}/solr/SolrHealthIndicator.java[`SolrHealthIndicator`]
+| Checks that a Solr server is up.
+|===
+
+TIP: You can disable them all by setting the configprop:management.health.defaults.enabled[] property.
+
+Additional `HealthIndicators` are available but not enabled by default:
+
+[cols="3,4,6"]
+|===
+| Key | Name | Description
+
+| `livenessstate`
+| {spring-boot-actuator-module-code}/availability/LivenessStateHealthIndicator.java[`LivenessStateHealthIndicator`]
+| Exposes the "Liveness" application availability state.
+
+| `readinessstate`
+| {spring-boot-actuator-module-code}/availability/ReadinessStateHealthIndicator.java[`ReadinessStateHealthIndicator`]
+| Exposes the "Readiness" application availability state.
+|===
+
+
+
+[[actuator.endpoints.health.writing-custom-health-indicators]]
+==== Writing Custom HealthIndicators
+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:
+
+[source,java,pending-extract=true,indent=0]
+----
+ import org.springframework.boot.actuate.health.Health;
+ import org.springframework.boot.actuate.health.HealthIndicator;
+ import org.springframework.stereotype.Component;
+
+ @Component
+ public class MyHealthIndicator implements HealthIndicator {
+
+ @Override
+ public Health health() {
+ int errorCode = check(); // perform some specific health check
+ if (errorCode != 0) {
+ return Health.down().withDetail("Error Code", errorCode).build();
+ }
+ return Health.up().build();
+ }
+
+ }
+----
+
+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 {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 configprop: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:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoint:
+ health:
+ status:
+ order: "fatal,down,out-of-service,unknown,up"
+----
+
+The HTTP status code in the response reflects the overall health status.
+By default, `OUT_OF_SERVICE` and `DOWN` map to 503.
+Any unmapped health statuses, including `UP`, map to 200.
+You might also want to register custom status mappings if you access the health endpoint over HTTP.
+Configuring a custom mapping disables the defaults mappings for `DOWN` and `OUT_OF_SERVICE`.
+If you want to retain the default mappings they must be configured explicitly alongside any custom mappings.
+For example, the following property maps `FATAL` to 503 (service unavailable) and retains the default mappings for `DOWN` and `OUT_OF_SERVICE`:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoint:
+ health:
+ status:
+ http-mapping:
+ down: 503
+ fatal: 503
+ out-of-service: 503
+----
+
+TIP: If you need more control, you can define your own `HttpCodeStatusMapper` bean.
+
+The following table shows the default status mappings for the built-in statuses:
+
+[cols="1,3"]
+|===
+| Status | Mapping
+
+| DOWN
+| SERVICE_UNAVAILABLE (503)
+
+| OUT_OF_SERVICE
+| SERVICE_UNAVAILABLE (503)
+
+| UP
+| No mapping by default, so http status is 200
+
+| UNKNOWN
+| No mapping by default, so http status is 200
+|===
+
+
+
+[[actuator.endpoints.health.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 {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` should be used to register and unregister health indicators at runtime.
+If you need to register a regular `HealthContributor`, you should wrap it using `ReactiveHealthContributor#adapt`.
+
+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,pending-extract=true,indent=0]
+----
+ @Component
+ public class MyReactiveHealthIndicator implements ReactiveHealthIndicator {
+
+ @Override
+ public Mono health() {
+ return doHealthCheck() //perform some specific health check that returns a Mono
+ .onErrorResume(ex -> Mono.just(new Health.Builder().down(ex).build()));
+ }
+
+ }
+----
+
+TIP: To handle the error automatically, consider extending from `AbstractReactiveHealthIndicator`.
+
+
+
+[[actuator.endpoints.health.auto-configured-reactive-health-indicators]]
+==== Auto-configured ReactiveHealthIndicators
+The following `ReactiveHealthIndicators` are auto-configured by Spring Boot when appropriate:
+
+[cols="2,4,6"]
+|===
+| Key | Name | Description
+
+| `cassandra`
+| {spring-boot-actuator-module-code}/cassandra/CassandraDriverReactiveHealthIndicator.java[`CassandraDriverReactiveHealthIndicator`]
+| Checks that a Cassandra database is up.
+
+| `couchbase`
+| {spring-boot-actuator-module-code}/couchbase/CouchbaseReactiveHealthIndicator.java[`CouchbaseReactiveHealthIndicator`]
+| Checks that a Couchbase cluster is up.
+
+| `elasticsearch`
+| {spring-boot-actuator-module-code}/elasticsearch/ElasticsearchReactiveHealthIndicator.java[`ElasticsearchReactiveHealthIndicator`]
+| Checks that an Elasticsearch cluster is up.
+
+| `mongo`
+| {spring-boot-actuator-module-code}/mongo/MongoReactiveHealthIndicator.java[`MongoReactiveHealthIndicator`]
+| Checks that a Mongo database is up.
+
+| `neo4j`
+| {spring-boot-actuator-module-code}/neo4j/Neo4jReactiveHealthIndicator.java[`Neo4jReactiveHealthIndicator`]
+| Checks that a Neo4j database is up.
+
+| `redis`
+| {spring-boot-actuator-module-code}/redis/RedisReactiveHealthIndicator.java[`RedisReactiveHealthIndicator`]
+| Checks that a Redis server is up.
+|===
+
+TIP: If necessary, reactive indicators replace the regular ones.
+Also, any `HealthIndicator` that is not handled explicitly is wrapped automatically.
+
+
+
+[[actuator.endpoints.health.groups]]
+==== Health Groups
+It's sometimes useful to organize health indicators into groups that can be used for different purposes.
+
+To create a health indicator group you can use the `management.endpoint.health.group.` property and specify a list of health indicator IDs to `include` or `exclude`.
+For example, to create a group that includes only database indicators you can define the following:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoint:
+ health:
+ group:
+ custom:
+ include: "db"
+----
+
+You can then check the result by hitting `http://localhost:8080/actuator/health/custom`.
+
+Similarly, to create a group that excludes the database indicators from the group and includes all the other indicators, you can define the following:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoint:
+ health:
+ group:
+ custom:
+ exclude: "db"
+----
+
+By default groups will inherit the same `StatusAggregator` and `HttpCodeStatusMapper` settings as the system health, however, these can also be defined on a per-group basis.
+It's also possible to override the `show-details` and `roles` properties if required:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoint:
+ health:
+ group:
+ custom:
+ show-details: "when-authorized"
+ roles: "admin"
+ status:
+ order: "fatal,up"
+ http-mapping:
+ fatal: 500
+ out-of-service: 500
+----
+
+TIP: You can use `@Qualifier("groupname")` if you need to register custom `StatusAggregator` or `HttpCodeStatusMapper` beans for use with the group.
+
+
+
+[[actuator.endpoints.health.datasource]]
+==== DataSource Health
+The `DataSource` health indicator shows the health of both standard data source and routing data source beans.
+The health of a routing data source includes the health of each of its target data sources.
+In the health endpoint's response, each of a routing data source's targets is named using its routing key.
+If you prefer not to include routing data sources in the indicator's output, set configprop:management.health.db.ignore-routing-data-sources[] to `true`.
+
+
+
+[[actuator.endpoints.kubernetes-probes]]
+=== Kubernetes Probes
+Applications deployed on Kubernetes can provide information about their internal state with https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes[Container Probes].
+Depending on https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/[your Kubernetes configuration], the kubelet will call those probes and react to the result.
+
+Spring Boot manages your <> out-of-the-box.
+If deployed in a Kubernetes environment, actuator will gather the "Liveness" and "Readiness" information from the `ApplicationAvailability` interface and use that information in dedicated <>: `LivenessStateHealthIndicator` and `ReadinessStateHealthIndicator`.
+These indicators will be shown on the global health endpoint (`"/actuator/health"`).
+They will also be exposed as separate HTTP Probes using <>: `"/actuator/health/liveness"` and `"/actuator/health/readiness"`.
+
+You can then configure your Kubernetes infrastructure with the following endpoint information:
+
+[source,yml,indent=0]
+----
+livenessProbe:
+ httpGet:
+ path: /actuator/health/liveness
+ port:
+ failureThreshold: ...
+ periodSeconds: ...
+
+readinessProbe:
+ httpGet:
+ path: /actuator/health/readiness
+ port:
+ failureThreshold: ...
+ periodSeconds: ...
+----
+
+NOTE: `` should be set to the port that the actuator endpoints are available on.
+It could be the main web server port, or a separate management port if the `"management.server.port"` property has been set.
+
+These health groups are only enabled automatically if the application is <>.
+You can enable them in any environment using the configprop:management.endpoint.health.probes.enabled[] configuration property.
+
+NOTE: If an application takes longer to start than the configured liveness period, Kubernetes mention the `"startupProbe"` as a possible solution.
+The `"startupProbe"` is not necessarily needed here as the `"readinessProbe"` fails until all startup tasks are done, see <>.
+
+WARNING: If your Actuator endpoints are deployed on a separate management context, be aware that endpoints are then not using the same web infrastructure (port, connection pools, framework components) as the main application.
+In this case, a probe check could be successful even if the main application does not work properly (for example, it cannot accept new connections).
+
+
+
+[[actuator.endpoints.kubernetes-probes.external-state]]
+==== Checking External State with Kubernetes Probes
+Actuator configures the "liveness" and "readiness" probes as Health Groups; this means that all the <> are available for them.
+You can, for example, configure additional Health Indicators:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoint:
+ health:
+ group:
+ readiness:
+ include: "readinessState,customCheck"
+----
+
+By default, Spring Boot does not add other Health Indicators to these groups.
+
+The "`liveness`" Probe should not depend on health checks for external systems.
+If the <> is broken, Kubernetes will try to solve that problem by restarting the application instance.
+This means that if an external system fails (e.g. a database, a Web API, an external cache), Kubernetes might restart all application instances and create cascading failures.
+
+As for the "`readiness`" Probe, the choice of checking external systems must be made carefully by the application developers, i.e. Spring Boot does not include any additional health checks in the readiness probe.
+If the <> is unready, Kubernetes will not route traffic to that instance.
+Some external systems might not be shared by application instances, in which case they could quite naturally be included in a readiness probe.
+Other external systems might not be essential to the application (the application could have circuit breakers and fallbacks), in which case they definitely should not be included.
+Unfortunately, an external system that is shared by all application instances is common, and you have to make a judgement call: include it in the readiness probe and expect that the application is taken out of service when the external service is down, or leave it out and deal with failures higher up the stack, e.g. using a circuit breaker in the caller.
+
+NOTE: If all instances of an application are unready, a Kubernetes Service with `type=ClusterIP` or `NodePort` will not accept any incoming connections.
+There is no HTTP error response (503 etc.) since there is no connection.
+A Service with `type=LoadBalancer` might or might not accept connections, depending on the provider.
+A Service that has an explicit https://kubernetes.io/docs/concepts/services-networking/ingress/[Ingress] will also respond in a way that depends on the implementation - the ingress service itself will have to decide how to handle the "connection refused" from downstream.
+HTTP 503 is quite likely in the case of both load balancer and ingress.
+
+Also, if an application is using Kubernetes https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/[autoscaling] it may react differently to applications being taken out of the load-balancer, depending on its autoscaler configuration.
+
+
+
+[[actuator.endpoints.kubernetes-probes.lifecycle]]
+==== Application Lifecycle and Probe States
+An important aspect of the Kubernetes Probes support is its consistency with the application lifecycle.
+There is a significant difference between the `AvailabilityState` which is the in-memory, internal state of the application
+and the actual Probe which exposes that state: depending on the phase of application lifecycle, the Probe might not be available.
+
+Spring Boot publishes <>,
+and Probes can listen to such events and expose the `AvailabilityState` information.
+
+The following tables show the `AvailabilityState` and the state of HTTP connectors at different stages.
+
+When a Spring Boot application starts:
+
+[cols="2,2,2,3,5"]
+|===
+|Startup phase |LivenessState |ReadinessState |HTTP server |Notes
+
+|Starting
+|`BROKEN`
+|`REFUSING_TRAFFIC`
+|Not started
+|Kubernetes checks the "liveness" Probe and restarts the application if it takes too long.
+
+|Started
+|`CORRECT`
+|`REFUSING_TRAFFIC`
+|Refuses requests
+|The application context is refreshed. The application performs startup tasks and does not receive traffic yet.
+
+|Ready
+|`CORRECT`
+|`ACCEPTING_TRAFFIC`
+|Accepts requests
+|Startup tasks are finished. The application is receiving traffic.
+|===
+
+When a Spring Boot application shuts down:
+
+[cols="2,2,2,3,5"]
+|===
+|Shutdown phase |Liveness State |Readiness State |HTTP server |Notes
+
+|Running
+|`CORRECT`
+|`ACCEPTING_TRAFFIC`
+|Accepts requests
+|Shutdown has been requested.
+
+|Graceful shutdown
+|`CORRECT`
+|`REFUSING_TRAFFIC`
+|New requests are rejected
+|If enabled, <>.
+
+|Shutdown complete
+|N/A
+|N/A
+|Server is shut down
+|The application context is closed and the application is shut down.
+|===
+
+TIP: Check out the <> for more information about Kubernetes deployment.
+
+
+
+[[actuator.endpoints.info]]
+=== Application Information
+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.
+
+
+
+[[actuator.endpoints.info.auto-configured-info-contributors]]
+==== Auto-configured InfoContributors
+The following `InfoContributor` beans are auto-configured by Spring Boot, when appropriate:
+
+[cols="1,4"]
+|===
+| Name | Description
+
+| {spring-boot-actuator-module-code}/info/EnvironmentInfoContributor.java[`EnvironmentInfoContributor`]
+| Exposes any key from the `Environment` under the `info` key.
+
+| {spring-boot-actuator-module-code}/info/GitInfoContributor.java[`GitInfoContributor`]
+| Exposes git information if a `git.properties` file is available.
+
+| {spring-boot-actuator-module-code}/info/BuildInfoContributor.java[`BuildInfoContributor`]
+| Exposes build information if a `META-INF/build-info.properties` file is available.
+|===
+
+TIP: It is possible to disable them all by setting the configprop:management.info.defaults.enabled[] property.
+
+
+
+[[actuator.endpoints.info.custom-application-information]]
+==== Custom Application Information
+You can customize the data exposed by the `info` endpoint by setting `+info.*+` Spring properties.
+All `Environment` properties under the `info` key are automatically exposed.
+For example, you could add the following settings to your `application.properties` file:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ info:
+ app:
+ encoding: "UTF-8"
+ java:
+ source: "11"
+ target: "11"
+----
+
+[TIP]
+====
+Rather than hardcoding those values, you could also <>.
+
+Assuming you use Maven, you could rewrite the preceding example as follows:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ info:
+ app:
+ encoding: "@project.build.sourceEncoding@"
+ java:
+ source: "@java.version@"
+ target: "@java.version@"
+----
+====
+
+
+
+[[actuator.endpoints.info.git-commit-information]]
+==== Git Commit Information
+Another useful feature of the `info` endpoint is its ability to publish information about the state of your `git` source code repository when the project was built.
+If a `GitProperties` bean is available, the `info` endpoint can be used to expose these properties.
+
+TIP: A `GitProperties` bean is auto-configured if a `git.properties` file is available at the root of the classpath.
+See "<>" for more details.
+
+By default, the endpoint exposes `git.branch`, `git.commit.id`, and `git.commit.time` properties, if present.
+If you don't want any of these properties in the endpoint response, they need to be excluded from the `git.properties` file.
+If you want to display the full git information (that is, the full content of `git.properties`), use the configprop:management.info.git.mode[] property, as follows:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ info:
+ git:
+ mode: "full"
+----
+
+To disable the git commit information from the `info` endpoint completely, set the configprop:management.info.git.enabled[] property to `false`, as follows:
+
+[source,properties,indent=0,configprops]
+----
+ management.info.git.enabled=false
+----
+
+
+
+[[actuator.endpoints.info.build-information]]
+==== Build Information
+If a `BuildProperties` bean is available, the `info` endpoint can also publish information about your build.
+This happens if a `META-INF/build-info.properties` file is available in the classpath.
+
+TIP: The Maven and Gradle plugins can both generate that file.
+See "<>" for more details.
+
+
+
+[[actuator.endpoints.info.writing-custom-info-contributors]]
+==== Writing Custom InfoContributors
+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:
+
+[source,java,pending-extract=true,indent=0]
+----
+ import java.util.Collections;
+
+ import org.springframework.boot.actuate.info.Info;
+ import org.springframework.boot.actuate.info.InfoContributor;
+ import org.springframework.stereotype.Component;
+
+ @Component
+ public class ExampleInfoContributor implements InfoContributor {
+
+ @Override
+ public void contribute(Info.Builder builder) {
+ builder.withDetail("example",
+ Collections.singletonMap("key", "value"));
+ }
+
+ }
+----
+
+If you reach the `info` endpoint, you should see a response that contains the following additional entry:
+
+[source,json,indent=0]
+----
+ {
+ "example": {
+ "key" : "value"
+ }
+ }
+----
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/jmx.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/jmx.adoc
new file mode 100644
index 0000000000..bc36fc6714
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/jmx.adoc
@@ -0,0 +1,99 @@
+[[actuator.jmx]]
+== Monitoring and Management over JMX
+Java Management Extensions (JMX) provide a standard mechanism to monitor and manage applications.
+By default, this feature is not enabled and can be turned on by setting the configuration property configprop:spring.jmx.enabled[] to `true`.
+Spring Boot exposes management endpoints as JMX MBeans under the `org.springframework.boot` domain by default.
+To Take full control over endpoints registration in the JMX domain, consider registering your own `EndpointObjectNameFactory` implementation.
+
+
+
+[[actuator.jmx.custom-mbean-names]]
+=== Customizing MBean Names
+The name of the MBean is usually generated from the `id` of the endpoint.
+For example, the `health` endpoint is exposed as `org.springframework.boot:type=Endpoint,name=Health`.
+
+If your application contains more than one Spring `ApplicationContext`, you may find that names clash.
+To solve this problem, you can set the configprop:spring.jmx.unique-names[] property to `true` so that MBean names are always unique.
+
+You can also customize the JMX domain under which endpoints are exposed.
+The following settings show an example of doing so in `application.properties`:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ spring:
+ jmx:
+ unique-names: true
+ management:
+ endpoints:
+ jmx:
+ domain: "com.example.myapp"
+----
+
+
+
+[[actuator.jmx.disable-jmx-endpoints]]
+=== Disabling JMX Endpoints
+If you do not want to expose endpoints over JMX, you can set the configprop:management.endpoints.jmx.exposure.exclude[] property to `*`, as shown in the following example:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoints:
+ jmx:
+ exposure:
+ exclude: "*"
+----
+
+
+
+[[actuator.jmx.jolokia]]
+=== Using Jolokia for JMX over HTTP
+Jolokia is a JMX-HTTP bridge that provides an alternative method of accessing JMX beans.
+To use Jolokia, include a dependency to `org.jolokia:jolokia-core`.
+For example, with Maven, you would add the following dependency:
+
+[source,xml,indent=0]
+----
+
+ org.jolokia
+ jolokia-core
+
+----
+
+The Jolokia endpoint can then be exposed by adding `jolokia` or `*` to the configprop:management.endpoints.web.exposure.include[] property.
+You can then access it by using `/actuator/jolokia` on your management HTTP server.
+
+NOTE: The Jolokia endpoint exposes Jolokia's servlet as an actuator endpoint.
+As a result, it is specific to servlet environments such as Spring MVC and Jersey.
+The endpoint will not be available in a WebFlux application.
+
+
+
+[[actuator.jmx.jolokia.customizing]]
+==== Customizing Jolokia
+Jolokia has a number of settings that you would traditionally configure by setting servlet parameters.
+With Spring Boot, you can use your `application.properties` file.
+To do so, prefix the parameter with `management.endpoint.jolokia.config.`, as shown in the following example:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoint:
+ jolokia:
+ config:
+ debug: true
+----
+
+
+
+[[actuator.jmx.jolokia.disabling]]
+==== Disabling Jolokia
+If you use Jolokia but do not want Spring Boot to configure it, set the configprop:management.endpoint.jolokia.enabled[] property to `false`, as follows:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoint:
+ jolokia:
+ enabled: false
+----
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/loggers.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/loggers.adoc
new file mode 100644
index 0000000000..74e320c669
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/loggers.adoc
@@ -0,0 +1,31 @@
+[[actuator.loggers]]
+== Loggers
+Spring Boot Actuator includes the ability to view and configure the log levels of your application at runtime.
+You can view either the entire list or an individual logger's configuration, which is made up of both the explicitly configured logging level as well as the effective logging level given to it by the logging framework.
+These levels can be one of:
+
+* `TRACE`
+* `DEBUG`
+* `INFO`
+* `WARN`
+* `ERROR`
+* `FATAL`
+* `OFF`
+* `null`
+
+`null` indicates that there is no explicit configuration.
+
+
+
+[[actuator.loggers.configure]]
+=== Configure a Logger
+To configure a given logger, `POST` a partial entity to the resource's URI, as shown in the following example:
+
+[source,json,indent=0]
+----
+ {
+ "configuredLevel": "DEBUG"
+ }
+----
+
+TIP: To "`reset`" the specific level of the logger (and use the default configuration instead), you can pass a value of `null` as the `configuredLevel`.
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc
new file mode 100644
index 0000000000..2a8128e9d8
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc
@@ -0,0 +1,1144 @@
+[[actuator.metrics]]
+== Metrics
+Spring Boot Actuator provides dependency management and auto-configuration for https://micrometer.io[Micrometer], an application metrics facade that supports {micrometer-docs}[numerous monitoring systems], including:
+
+- <>
+- <>
+- <>
+- <>
+- <>
+- <>
+- <>
+- <>
+- <>
+- <>
+- <>
+- <>
+- <>
+- <>
+- <>
+- <>
+- <>
+- <>
+
+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].
+
+
+
+[[actuator.metrics.getting-started]]
+=== Getting started
+Spring Boot auto-configures a composite `MeterRegistry` and adds a registry to the composite for each of the supported implementations that it finds on the classpath.
+Having a dependency on `micrometer-registry-\{system}` in your runtime classpath is enough for Spring Boot to configure the registry.
+
+Most registries share common features.
+For instance, you can disable a particular registry even if the Micrometer registry implementation is on the classpath.
+For example, to disable Datadog:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ datadog:
+ enabled: false
+----
+
+You can also disable all registries unless stated otherwise by the registry-specific property, as shown in the following example:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ defaults:
+ enabled: false
+----
+
+Spring Boot will also add any auto-configured registries to the global static composite registry on the `Metrics` class unless you explicitly tell it not to:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ use-global-registry: false
+----
+
+You can register any number of `MeterRegistryCustomizer` beans to further configure the registry, such as applying common tags, before any meters are registered with the registry:
+
+[source,java,pending-extract=true,indent=0]
+----
+ @Bean
+ MeterRegistryCustomizer metricsCommonTags() {
+ return registry -> registry.config().commonTags("region", "us-east-1");
+ }
+----
+
+You can apply customizations to particular registry implementations by being more specific about the generic type:
+
+[source,java,pending-extract=true,indent=0]
+----
+ @Bean
+ MeterRegistryCustomizer graphiteMetricsNamingConvention() {
+ return registry -> registry.config().namingConvention(MY_CUSTOM_CONVENTION);
+ }
+----
+
+Spring Boot also <> that you can control via configuration or dedicated annotation markers.
+
+
+
+[[actuator.metrics.export]]
+=== Supported Monitoring Systems
+
+
+
+[[actuator.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-docs}/appOptics[AppOptics], your API token must be provided:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ appoptics:
+ api-token: "YOUR_TOKEN"
+----
+
+
+
+[[actuator.metrics.export.atlas]]
+==== Atlas
+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,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ atlas:
+ uri: "https://atlas.example.com:7101/api/v1/publish"
+----
+
+
+
+[[actuator.metrics.export.datadog]]
+==== Datadog
+Datadog registry pushes metrics to https://www.datadoghq.com[datadoghq] periodically.
+To export metrics to {micrometer-registry-docs}/datadog[Datadog], your API key must be provided:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ datadog:
+ api-key: "YOUR_KEY"
+----
+
+You can also change the interval at which metrics are sent to Datadog:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ datadog:
+ step: "30s"
+----
+
+
+
+[[actuator.metrics.export.dynatrace]]
+==== Dynatrace
+Dynatrace registry pushes metrics to the configured URI periodically.
+To export metrics to {micrometer-registry-docs}/dynatrace[Dynatrace], your API token, device ID, and URI must be provided:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ dynatrace:
+ api-token: "YOUR_TOKEN"
+ device-id: "YOUR_DEVICE_ID"
+ uri: "YOUR_URI"
+----
+
+You can also change the interval at which metrics are sent to Dynatrace:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ dynatrace:
+ step: "30s"
+----
+
+
+
+[[actuator.metrics.export.elastic]]
+==== Elastic
+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,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ elastic:
+ host: "https://elastic.example.com:8086"
+----
+
+
+
+[[actuator.metrics.export.ganglia]]
+==== Ganglia
+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,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ ganglia:
+ host: "ganglia.example.com"
+ port: 9649
+----
+
+
+
+[[actuator.metrics.export.graphite]]
+==== Graphite
+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,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ graphite:
+ host: "graphite.example.com"
+ port: 9004
+----
+
+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:
+
+[source,java,pending-extract=true,indent=0]
+----
+ @Bean
+ public GraphiteMeterRegistry graphiteMeterRegistry(GraphiteConfig config, Clock clock) {
+ return new GraphiteMeterRegistry(config, clock, MY_HIERARCHICAL_MAPPER);
+ }
+----
+
+
+
+[[actuator.metrics.export.humio]]
+==== Humio
+By default, the Humio registry pushes metrics to https://cloud.humio.com periodically.
+To export metrics to SaaS {micrometer-registry-docs}/humio[Humio], your API token must be provided:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ humio:
+ api-token: "YOUR_TOKEN"
+----
+
+You should also configure one or more tags to identify the data source to which metrics will be pushed:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ humio:
+ tags:
+ alpha: "a"
+ bravo: "b"
+----
+
+
+
+[[actuator.metrics.export.influx]]
+==== Influx
+By default, metrics are exported to an {micrometer-registry-docs}/influx[Influx] v1 instance running on your local machine with the default configuration.
+To export metrics to InfluxDB v2, configure the `org`, `bucket`, and authentication `token` for writing metrics.
+The location of the https://www.influxdata.com[Influx server] to use can be provided using:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ influx:
+ uri: "https://influx.example.com:8086"
+----
+
+
+
+[[actuator.metrics.export.jmx]]
+==== JMX
+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:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ jmx:
+ domain: "com.example.app.metrics"
+----
+
+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:
+
+[source,java,pending-extract=true,indent=0]
+----
+ @Bean
+ public JmxMeterRegistry jmxMeterRegistry(JmxConfig config, Clock clock) {
+ return new JmxMeterRegistry(config, clock, MY_HIERARCHICAL_MAPPER);
+ }
+----
+
+
+
+[[actuator.metrics.export.kairos]]
+==== KairosDB
+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,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ kairos:
+ uri: "https://kairosdb.example.com:8080/api/v1/datapoints"
+----
+
+
+
+[[actuator.metrics.export.newrelic]]
+==== New Relic
+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,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ newrelic:
+ api-key: "YOUR_KEY"
+ account-id: "YOUR_ACCOUNT_ID"
+----
+
+You can also change the interval at which metrics are sent to New Relic:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ newrelic:
+ step: "30s"
+----
+
+By default, metrics are published via REST calls but it is also possible to use the Java Agent API if you have it on the classpath:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ newrelic:
+ client-provider-type: "insights-agent"
+----
+
+Finally, you can take full control by defining your own `NewRelicClientProvider` bean.
+
+
+
+[[actuator.metrics.export.prometheus]]
+==== Prometheus
+{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 <> for more details.
+
+Here is an example `scrape_config` to add to `prometheus.yml`:
+
+[source,yaml,indent=0]
+----
+ scrape_configs:
+ - job_name: 'spring'
+ metrics_path: '/actuator/prometheus'
+ static_configs:
+ - targets: ['HOST:PORT']
+----
+
+For ephemeral or batch jobs which may not exist long enough to be scraped, https://github.com/prometheus/pushgateway[Prometheus Pushgateway] support can be used to expose their metrics to Prometheus.
+To enable Prometheus Pushgateway support, add the following dependency to your project:
+
+[source,xml,indent=0]
+----
+
+ io.prometheus
+ simpleclient_pushgateway
+
+----
+
+When the Prometheus Pushgateway dependency is present on the classpath and the configprop:management.metrics.export.prometheus.pushgateway.enabled[] property is set to `true`, a `PrometheusPushGatewayManager` bean is auto-configured.
+This manages the pushing of metrics to a Prometheus Pushgateway.
+
+The `PrometheusPushGatewayManager` can be tuned using properties under `management.metrics.export.prometheus.pushgateway`.
+For advanced configuration, you can also provide your own `PrometheusPushGatewayManager` bean.
+
+
+
+[[actuator.metrics.export.signalfx]]
+==== SignalFx
+SignalFx registry pushes metrics to {micrometer-registry-docs}/signalFx[SignalFx] periodically.
+To export metrics to https://www.signalfx.com[SignalFx], your access token must be provided:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ signalfx:
+ access-token: "YOUR_ACCESS_TOKEN"
+----
+
+You can also change the interval at which metrics are sent to SignalFx:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ signalfx:
+ step: "30s"
+----
+
+
+
+[[actuator.metrics.export.simple]]
+==== Simple
+Micrometer ships with a simple, in-memory backend that is automatically used as a fallback if no other registry is configured.
+This allows you to see what metrics are collected in the <>.
+
+The in-memory backend disables itself as soon as you're using any of the other available backend.
+You can also disable it explicitly:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ simple:
+ enabled: false
+----
+
+
+
+[[actuator.metrics.export.stackdriver]]
+==== Stackdriver
+Stackdriver registry pushes metrics to https://cloud.google.com/stackdriver/[Stackdriver] periodically.
+To export metrics to SaaS {micrometer-registry-docs}/stackdriver[Stackdriver], your Google Cloud project id must be provided:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ stackdriver:
+ project-id: "my-project"
+----
+
+You can also change the interval at which metrics are sent to Stackdriver:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ stackdriver:
+ step: "30s"
+----
+
+
+
+[[actuator.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-docs}/statsD[StatsD] agent running on your local machine.
+The StatsD agent host, port, and protocol to use can be provided using:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ statsd:
+ host: "statsd.example.com"
+ port: 9125
+ protocol: "udp"
+----
+
+You can also change the StatsD line protocol to use (default to Datadog):
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ statsd:
+ flavor: "etsy"
+----
+
+
+
+[[actuator.metrics.export.wavefront]]
+==== Wavefront
+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,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ wavefront:
+ api-token: "YOUR_API_TOKEN"
+----
+
+Alternatively, you may use a Wavefront sidecar or an internal proxy set up in your environment that forwards metrics data to the Wavefront API host:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ wavefront:
+ uri: "proxy://localhost:2878"
+----
+
+TIP: If publishing metrics to a Wavefront proxy (as described in https://docs.wavefront.com/proxies_installing.html[the documentation]), the host must be in the `proxy://HOST:PORT` format.
+
+You can also change the interval at which metrics are sent to Wavefront:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ export:
+ wavefront:
+ step: "30s"
+----
+
+
+
+[[actuator.metrics.supported]]
+=== Supported Metrics and Meters
+Spring Boot provides automatic meter registration for a wide variety of technologies.
+In most situations, the out-of-the-box defaults will provide sensible metrics that can be published to any of the supported monioring systems.
+
+
+
+[[actuator.metrics.supported.jvm]]
+==== JVM Metrics
+Auto-configuration will enable JVM Metrics using core Micrometer classes.
+JVM metrics are published under the `jvm.` meter name.
+
+The following JVM metrics are provided:
+
+* Various memory and buffer pool details
+* Statistics related to garbage collection
+* Threads utilization
+* The Number of classes loaded/unloaded
+
+
+
+[[actuator.metrics.supported.system]]
+==== System Metrics
+Auto-configuration will enable system metrics using core Micrometer classes.
+System metrics are published under the `system.` and `process.` meter names.
+
+The following system metrics are provided:
+
+* CPU metrics
+* File descriptor metrics
+* Uptime metrics (both the amount of time the application has been running as well as a fixed gauge of the absolute start time)
+
+
+
+[[actuator.metrics.supported.logger]]
+==== Logger Metrics
+Auto-configuration enables the event metrics for both Logback and Log4J2.
+Details are published under the `log4j2.events.` or `logback.events.` meter names.
+
+
+
+[[actuator.metrics.supported.spring-mvc]]
+==== Spring MVC Metrics
+Auto-configuration enables the instrumentation of all requests handled by Spring MVC controllers and functional handlers.
+By default, metrics are generated with the name, `http.server.requests`.
+The name can be customized by setting the configprop:management.metrics.web.server.request.metric-name[] property.
+
+`@Timed` annotations are supported on `@Controller` classes and `@RequestMapping` methods (see <> for details).
+If you don't want to record metrics for all Spring MVC requests, you can set configprop:management.metrics.web.server.request.autotime.enabled[] to `false` and exclusively use `@Timed` annotations instead.
+
+By default, Spring MVC related metrics are tagged with the following information:
+
+|===
+| Tag | Description
+
+| `exception`
+| Simple class name of any exception that was thrown while handling the request.
+
+| `method`
+| Request's method (for example, `GET` or `POST`)
+
+| `outcome`
+| Request's outcome based on the status code of the response.
+ 1xx is `INFORMATIONAL`, 2xx is `SUCCESS`, 3xx is `REDIRECTION`, 4xx `CLIENT_ERROR`, and 5xx is `SERVER_ERROR`
+
+| `status`
+| Response's HTTP status code (for example, `200` or `500`)
+
+| `uri`
+| Request's URI template prior to variable substitution, if possible (for example, `/api/person/\{id}`)
+|===
+
+To add to the default tags, provide one or more ``@Bean``s that implement `WebMvcTagsContributor`.
+To replace the default tags, provide a `@Bean` that implements `WebMvcTagsProvider`.
+
+TIP: In some cases, exceptions handled in Web controllers are not recorded as request metrics tags.
+Applications can opt-in and record exceptions by <>.
+
+
+
+[[actuator.metrics.supported.spring-webflux]]
+==== Spring WebFlux Metrics
+Auto-configuration enables the instrumentation of all requests handled by Spring WebFlux controllers and functional handlers.
+By default, metrics are generated with the name, `http.server.requests`.
+The name can be customized by setting the configprop:management.metrics.web.server.request.metric-name[] property.
+
+`@Timed` annotations are supported on `@Controller` classes and `@RequestMapping` methods (see <> for details).
+If you don't want to record metrics for all Spring WebFlux requests, you can set configprop:management.metrics.web.server.request.autotime.enabled[] to `false` and exclusively use `@Timed` annotations instead.
+
+By default, WebFlux related metrics are tagged with the following information:
+
+|===
+| Tag | Description
+
+| `exception`
+| Simple class name of any exception that was thrown while handling the request.
+
+| `method`
+| Request's method (for example, `GET` or `POST`)
+
+| `outcome`
+| Request's outcome based on the status code of the response.
+ 1xx is `INFORMATIONAL`, 2xx is `SUCCESS`, 3xx is `REDIRECTION`, 4xx `CLIENT_ERROR`, and 5xx is `SERVER_ERROR`
+
+| `status`
+| Response's HTTP status code (for example, `200` or `500`)
+
+| `uri`
+| Request's URI template prior to variable substitution, if possible (for example, `/api/person/\{id}`)
+|===
+
+To add to the default tags, provide one or more ``@Bean``s that implement `WebFluxTagsContributor`.
+To replace the default tags, provide a `@Bean` that implements `WebFluxTagsProvider`.
+
+TIP: In some cases, exceptions handled in controllers and handler functions are not recorded as request metrics tags.
+Applications can opt-in and record exceptions by <>.
+
+
+
+[[actuator.metrics.supported.jersey]]
+==== Jersey Server Metrics
+Auto-configuration enables the instrumentation of all requests handled by the Jersey JAX-RS implementation whenever Micrometer's `micrometer-jersey2` module is on the classpath.
+By default, metrics are generated with the name, `http.server.requests`.
+The name can be customized by setting the configprop:management.metrics.web.server.request.metric-name[] property.
+
+`@Timed` annotations are supported on request-handling classes and methods (see <> for details).
+If you don't want to record metrics for all Jersey requests, you can set configprop:management.metrics.web.server.request.autotime.enabled[] to `false` and exclusively use `@Timed` annotations instead.
+
+By default, Jersey server metrics are tagged with the following information:
+
+|===
+| Tag | Description
+
+| `exception`
+| Simple class name of any exception that was thrown while handling the request.
+
+| `method`
+| Request's method (for example, `GET` or `POST`)
+
+| `outcome`
+| Request's outcome based on the status code of the response.
+ 1xx is `INFORMATIONAL`, 2xx is `SUCCESS`, 3xx is `REDIRECTION`, 4xx `CLIENT_ERROR`, and 5xx is `SERVER_ERROR`
+
+| `status`
+| Response's HTTP status code (for example, `200` or `500`)
+
+| `uri`
+| Request's URI template prior to variable substitution, if possible (for example, `/api/person/\{id}`)
+|===
+
+To customize the tags, provide a `@Bean` that implements `JerseyTagsProvider`.
+
+
+
+[[actuator.metrics.supported.http-clients]]
+==== HTTP Client Metrics
+Spring Boot Actuator manages the instrumentation of both `RestTemplate` and `WebClient`.
+For that, you have to inject the auto-configured builder and use it to create instances:
+
+* `RestTemplateBuilder` for `RestTemplate`
+* `WebClient.Builder` for `WebClient`
+
+It is also possible to apply manually the customizers responsible for this instrumentation, namely `MetricsRestTemplateCustomizer` and `MetricsWebClientCustomizer`.
+
+By default, metrics are generated with the name, `http.client.requests`.
+The name can be customized by setting the configprop:management.metrics.web.client.request.metric-name[] property.
+
+By default, metrics generated by an instrumented client are tagged with the following information:
+
+|===
+| Tag | Description
+
+| `clientName`
+| Host portion of the URI
+
+| `method`
+| Request's method (for example, `GET` or `POST`)
+
+| `outcome`
+| Request's outcome based on the status code of the response.
+ 1xx is `INFORMATIONAL`, 2xx is `SUCCESS`, 3xx is `REDIRECTION`, 4xx `CLIENT_ERROR`, and 5xx is `SERVER_ERROR`, `UNKNOWN` otherwise
+
+| `status`
+| Response's HTTP status code if available (for example, `200` or `500`), or `IO_ERROR` in case of I/O issues, `CLIENT_ERROR` otherwise
+
+| `uri`
+| Request's URI template prior to variable substitution, if possible (for example, `/api/person/\{id}`)
+|===
+
+To customize the tags, and depending on your choice of client, you can provide a `@Bean` that implements `RestTemplateExchangeTagsProvider` or `WebClientExchangeTagsProvider`.
+There are convenience static functions in `RestTemplateExchangeTags` and `WebClientExchangeTags`.
+
+
+
+[[actuator.metrics.supported.tomcat]]
+==== Tomcat Metrics
+Auto-configuration will enable the instrumentation of Tomcat only when an `MBeanRegistry` is enabled.
+By default, the `MBeanRegistry` is disabled, but you can enable it by setting configprop:server.tomcat.mbeanregistry.enabled[] to `true`.
+
+Tomcat metrics are published under the `tomcat.` meter name.
+
+
+
+[[actuator.metrics.supported.cache]]
+==== Cache Metrics
+Auto-configuration enables the instrumentation of all available ``Cache``s on startup with metrics prefixed with `cache`.
+Cache instrumentation is standardized for a basic set of metrics.
+Additional, cache-specific metrics are also available.
+
+The following cache libraries are supported:
+
+* Caffeine
+* EhCache 2
+* Hazelcast
+* Any compliant JCache (JSR-107) implementation
+* Redis
+
+Metrics are tagged by the name of the cache and by the name of the `CacheManager` that is derived from the bean name.
+
+NOTE: Only caches that are configured on startup are bound to the registry.
+For caches not defined in the cache’s configuration, e.g. caches created on-the-fly or programmatically after the startup phase, an explicit registration is required.
+A `CacheMetricsRegistrar` bean is made available to make that process easier.
+
+
+
+[[actuator.metrics.supported.jdbc]]
+==== DataSource Metrics
+Auto-configuration enables the instrumentation of all available `DataSource` objects with metrics prefixed with `jdbc.connections`.
+Data source instrumentation results in gauges representing the currently active, idle, maximum allowed, and minimum allowed connections in the pool.
+
+Metrics are also tagged by the name of the `DataSource` computed based on the bean name.
+
+TIP: By default, Spring Boot provides metadata for all supported data sources; you can add additional `DataSourcePoolMetadataProvider` beans if your favorite data source isn't supported out of the box.
+See `DataSourcePoolMetadataProvidersConfiguration` for examples.
+
+Also, Hikari-specific metrics are exposed with a `hikaricp` prefix.
+Each metric is tagged by the name of the Pool (can be controlled with `spring.datasource.name`).
+
+
+
+[[actuator.metrics.supported.hibernate]]
+==== Hibernate Metrics
+If `org.hibernate:hibernate-micrometer` is on the classpath, all available Hibernate `EntityManagerFactory` instances that have statistics enabled are instrumented with a metric named `hibernate`.
+
+Metrics are also tagged by the name of the `EntityManagerFactory` that is derived from the bean name.
+
+To enable statistics, the standard JPA property `hibernate.generate_statistics` must be set to `true`.
+You can enable that on the auto-configured `EntityManagerFactory` as shown in the following example:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ spring:
+ jpa:
+ properties:
+ "[hibernate.generate_statistics]": true
+----
+
+
+
+[[actuator.metrics.supported.spring-data-repository]]
+==== Spring Data Repository Metrics
+Auto-configuration enables the instrumentation of all Spring Data `Repository` method invocations.
+By default, metrics are generated with the name, `spring.data.repository.invocations`.
+The name can be customized by setting the configprop:management.metrics.data.repository.metric-name[] property.
+
+`@Timed` annotations are supported on `Repository` classes and methods (see <> for details).
+If you don't want to record metrics for all `Repository` invocations, you can set configprop:management.metrics.data.repository.autotime.enabled[] to `false` and exclusively use `@Timed` annotations instead.
+
+By default, repository invocation related metrics are tagged with the following information:
+
+|===
+| Tag | Description
+
+| `repository`
+| Simple class name of the source `Repository`.
+
+| `method`
+| The name of the `Repository` method that was invoked.
+
+| `state`
+| The result state (`SUCCESS`, `ERROR`, `CANCELED` or `RUNNING`).
+
+| `exception`
+| Simple class name of any exception that was thrown from the invocation.
+|===
+
+To replace the default tags, provide a `@Bean` that implements `RepositoryTagsProvider`.
+
+
+
+[[actuator.metrics.supported.rabbitmq]]
+==== RabbitMQ Metrics
+Auto-configuration will enable the instrumentation of all available RabbitMQ connection factories with a metric named `rabbitmq`.
+
+
+
+[[actuator.metrics.supported.spring-integration]]
+==== Spring Integration Metrics
+Spring Integration provides {spring-integration-docs}system-management.html#micrometer-integration[Micrometer support] automatically whenever a `MeterRegistry` bean is available.
+Metrics are published under the `spring.integration.` meter name.
+
+
+
+[[actuator.metrics.supported.kafka]]
+==== Kafka Metrics
+Auto-configuration will register a `MicrometerConsumerListener` and `MicrometerProducerListener` for the auto-configured consumer factory and producer factory respectively.
+It will also register a `KafkaStreamsMicrometerListener` for `StreamsBuilderFactoryBean`.
+For more details refer to {spring-kafka-docs}#micrometer-native[Micrometer Native Metrics] section of the Spring Kafka documentation.
+
+
+
+[[actuator.metrics.supported.mongodb]]
+==== MongoDB Metrics
+
+
+
+[[actuator.metrics.supported.mongodb.command]]
+===== Command Metrics
+Auto-configuration will register a `MongoMetricsCommandListener` with the auto-configured `MongoClient`.
+
+A timer metric with the name `mongodb.driver.commands` is created for each command issued to the underlying MongoDB driver.
+Each metric is tagged with the following information by default:
+|===
+| Tag | Description
+
+| `command`
+| Name of the command issued
+
+| `cluster.id`
+| Identifier of the cluster the command was sent to
+
+| `server.address`
+| Address of the server the command was sent to
+
+| `status`
+| Outcome of the command - one of (`SUCCESS`, `FAILED`)
+|===
+
+To replace the default metric tags, define a `MongoCommandTagsProvider` bean, as shown in the following example:
+
+[source,java,indent=0]
+----
+include::{include-productionreadyfeatures}/metrics/mongo/SampleCommandTagsProviderConfiguration.java[]
+----
+
+To disable the auto-configured command metrics, set the following property:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ mongo:
+ command:
+ enabled: false
+----
+
+
+
+[[actuator.metrics.supported.mongodb.connection-pool]]
+===== Connection Pool Metrics
+Auto-configuration will register a `MongoMetricsConnectionPoolListener` with the auto-configured `MongoClient`.
+
+The following gauge metrics are created for the connection pool:
+
+* `mongodb.driver.pool.size` that reports the current size of the connection pool, including idle and and in-use members
+* `mongodb.driver.pool.checkedout` that reports the count of connections that are currently in use
+* `mongodb.driver.pool.waitqueuesize` that reports the current size of the wait queue for a connection from the pool
+
+Each metric is tagged with the following information by default:
+|===
+| Tag | Description
+
+| `cluster.id`
+| Identifier of the cluster the connection pool corresponds to
+
+| `server.address`
+| Address of the server the connection pool corresponds to
+|===
+
+To replace the default metric tags, define a `MongoConnectionPoolTagsProvider` bean, as shown in the following example:
+
+[source,java,indent=0]
+----
+include::{include-productionreadyfeatures}/metrics/mongo/SampleConnectionPoolTagsProviderConfiguration.java[tag=*]
+----
+
+To disable the auto-configured connection pool metrics, set the following property:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ mongo:
+ connectionpool:
+ enabled: false
+----
+
+
+
+[[actuator.metrics.supported.timed-annotation]]
+==== @Timed Annotation Support
+The `@Timed` annotation from the `io.micrometer.core.annotation` package can be used with several of the supported technologies listed above.
+If supported, the annotation can be used either at the class-level or the method-level.
+
+For example, the following code shows how the annotation can be used to instrument all request mappings in a `@RestController`:
+
+[source,java,pending-extract=true,indent=0]
+----
+ @RestController
+ @Timed
+ public class MyController {
+
+ @GetMapping("/api/addresses")
+ public List listAddress() { ... }
+
+ @GetMapping("/api/people")
+ public List listPeople() { ... }
+
+ }
+----
+
+If you only want to instrument a single mapping, you can use the annotation on the method instead of the class:
+
+[source,java,pending-extract=true,indent=0]
+----
+ @RestController
+ public class MyController {
+
+ @GetMapping("/api/addresses")
+ public List listAddress() { ... }
+
+ @GetMapping("/api/people")
+ @Timed
+ public List listPeople() { ... }
+
+ }
+----
+
+You can also combine class-level and method-level annotations if you want to change timing details for a specific method:
+
+[source,java,pending-extract=true,indent=0]
+----
+ @RestController
+ @Timed
+ public class MyController {
+
+ @GetMapping("/api/addresses")
+ public List listPeople() { ... }
+
+ @GetMapping("/api/people")
+ @Timed(extraTags = { "region", "us-east-1" })
+ @Timed(value = "all.people", longTask = true)
+ public List listPeople() { ... }
+
+ }
+----
+
+NOTE: A `@Timed` annotation with `longTask = true` will enable a long task timer for the method.
+Long task timers require a separate metric name, and can be stacked with a short task timer.
+
+
+
+[[actuator.metrics.registering-custom]]
+=== Registering Custom Metrics
+To register custom metrics, inject `MeterRegistry` into your component, as shown in the following example:
+
+[source,java,indent=0]
+----
+include::{include-productionreadyfeatures}/metrics/MetricsMeterRegistryInjection.java[tag=*]
+----
+
+If your metrics depend on other beans, it is recommended that you use a `MeterBinder` to register them, as shown in the following example:
+
+[source,java,indent=0]
+----
+include::{include-productionreadyfeatures}/metrics/SampleMeterBinderConfiguration.java[tag=*]
+----
+
+Using a `MeterBinder` ensures that the correct dependency relationships are set up and that the bean is available when the metric's value is retrieved.
+A `MeterBinder` implementation can also be useful if you find that you repeatedly instrument a suite of metrics across components or applications.
+
+NOTE: By default, metrics from all `MeterBinder` beans will be automatically bound to the Spring-managed `MeterRegistry`.
+
+
+
+[[actuator.metrics.customizing]]
+=== Customizing Individual Metrics
+If you need to apply customizations to specific `Meter` instances you can use the `io.micrometer.core.instrument.config.MeterFilter` interface.
+
+For example, if you want to rename the `mytag.region` tag to `mytag.area` for all meter IDs beginning with `com.example`, you can do the following:
+
+[source,java,indent=0]
+----
+include::{include-productionreadyfeatures}/metrics/MetricsFilterConfiguration.java[tag=*]
+----
+
+NOTE: By default, all `MeterFilter` beans will be automatically bound to the Spring-managed `MeterRegistry`.
+Make sure to register your metrics using the Spring-managed `MeterRegistry` and not any of the static methods on `Metrics`.
+These use the global registry that is not Spring-managed.
+
+
+
+[[actuator.metrics.customizing.common-tags]]
+==== Common Tags
+Common tags are generally used for dimensional drill-down on the operating environment like host, instance, region, stack, etc.
+Commons tags are applied to all meters and can be configured as shown in the following example:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ tags:
+ region: "us-east-1"
+ stack: "prod"
+----
+
+The example above adds `region` and `stack` tags to all meters with a value of `us-east-1` and `prod` respectively.
+
+NOTE: The order of common tags is important if you are using Graphite.
+As the order of common tags cannot be guaranteed using this approach, Graphite users are advised to define a custom `MeterFilter` instead.
+
+
+
+[[actuator.metrics.customizing.per-meter-properties]]
+==== Per-meter Properties
+In addition to `MeterFilter` beans, it's also possible to apply a limited set of customization on a per-meter basis using properties.
+Per-meter customizations apply to any all meter IDs that start with the given name.
+For example, the following will disable any meters that have an ID starting with `example.remote`
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ metrics:
+ enable:
+ example:
+ remote: false
+----
+
+The following properties allow per-meter customization:
+
+.Per-meter customizations
+|===
+| Property | Description
+
+| configprop:management.metrics.enable[]
+| Whether to deny meters from emitting any metrics.
+
+| configprop:management.metrics.distribution.percentiles-histogram[]
+| Whether to publish a histogram suitable for computing aggregable (across dimension) percentile approximations.
+
+| configprop:management.metrics.distribution.minimum-expected-value[], configprop:management.metrics.distribution.maximum-expected-value[]
+| Publish less histogram buckets by clamping the range of expected values.
+
+| configprop:management.metrics.distribution.percentiles[]
+| Publish percentile values computed in your application
+
+| configprop:management.metrics.distribution.slo[]
+| Publish a cumulative histogram with buckets defined by your service-level objectives.
+|===
+
+For more details on concepts behind `percentiles-histogram`, `percentiles` and `slo` refer to the {micrometer-concepts-docs}#_histograms_and_percentiles["Histograms and percentiles" section] of the micrometer documentation.
+
+
+
+[[actuator.metrics.endpoint]]
+=== Metrics Endpoint
+Spring Boot provides a `metrics` endpoint that can be used diagnostically to examine the metrics collected by an application.
+The endpoint is not available by default and must be exposed, see <> for more details.
+
+Navigating to `/actuator/metrics` displays a list of available meter names.
+You can drill down to view information about a particular meter by providing its name as a selector, e.g. `/actuator/metrics/jvm.memory.max`.
+
+[TIP]
+====
+The name you use here should match the name used in the code, not the name after it has been naming-convention normalized for a monitoring system it is shipped to.
+In other words, if `jvm.memory.max` appears as `jvm_memory_max` in Prometheus because of its snake case naming convention, you should still use `jvm.memory.max` as the selector when inspecting the meter in the `metrics` endpoint.
+====
+
+You can also add any number of `tag=KEY:VALUE` query parameters to the end of the URL to dimensionally drill down on a meter, e.g. `/actuator/metrics/jvm.memory.max?tag=area:nonheap`.
+
+[TIP]
+====
+The reported measurements are the _sum_ of the statistics of all meters matching the meter name and any tags that have been applied.
+So in the example above, the returned "Value" statistic is the sum of the maximum memory footprints of "Code Cache", "Compressed Class Space", and "Metaspace" areas of the heap.
+If you only wanted to see the maximum size for the "Metaspace", you could add an additional `tag=id:Metaspace`, i.e. `/actuator/metrics/jvm.memory.max?tag=area:nonheap&tag=id:Metaspace`.
+====
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/monitoring.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/monitoring.adoc
new file mode 100644
index 0000000000..b93fcf75ea
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/monitoring.adoc
@@ -0,0 +1,148 @@
+[[actuator.monitoring]]
+== Monitoring and Management over HTTP
+If you are developing a web application, Spring Boot Actuator auto-configures all enabled endpoints to be exposed over HTTP.
+The default convention is to use the `id` of the endpoint with a prefix of `/actuator` as the URL path.
+For example, `health` is exposed as `/actuator/health`.
+
+TIP: Actuator is supported natively with Spring MVC, Spring WebFlux, and Jersey.
+If both Jersey and Spring MVC are available, Spring MVC will be used.
+
+NOTE: Jackson is a required dependency in order to get the correct JSON responses as documented in the API documentation ({spring-boot-actuator-restapi-docs}[HTML] or {spring-boot-actuator-restapi-pdfdocs}[PDF]).
+
+
+
+[[actuator.monitoring.customizing-management-server-context-path]]
+=== Customizing the Management Endpoint Paths
+Sometimes, it is useful to customize the prefix for the management endpoints.
+For example, your application might already use `/actuator` for another purpose.
+You can use the configprop:management.endpoints.web.base-path[] property to change the prefix for your management endpoint, as shown in the following example:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoints:
+ web:
+ base-path: "/manage"
+----
+
+The preceding `application.properties` example changes the endpoint from `/actuator/\{id}` to `/manage/\{id}` (for example, `/manage/info`).
+
+NOTE: Unless the management port has been configured to <>, `management.endpoints.web.base-path` is relative to `server.servlet.context-path` (Servlet web applications) or `spring.webflux.base-path` (reactive web applications).
+If `management.server.port` is configured, `management.endpoints.web.base-path` is relative to `management.server.base-path`.
+
+If you want to map endpoints to a different path, you can use the configprop:management.endpoints.web.path-mapping[] property.
+
+The following example remaps `/actuator/health` to `/healthcheck`:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoints:
+ web:
+ base-path: "/"
+ path-mapping:
+ health: "healthcheck"
+----
+
+
+
+[[actuator.monitoring.customizing-management-server-port]]
+=== Customizing the Management Server Port
+Exposing management endpoints by using the default HTTP port is a sensible choice for cloud-based deployments.
+If, however, your application runs inside your own data center, you may prefer to expose endpoints by using a different HTTP port.
+
+You can set the configprop:management.server.port[] property to change the HTTP port, as shown in the following example:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ server:
+ port: 8081
+----
+
+NOTE: On Cloud Foundry, applications only receive requests on port 8080 for both HTTP and TCP routing, by default.
+If you want to use a custom management port on Cloud Foundry, you will need to explicitly set up the application's routes to forward traffic to the custom port.
+
+
+
+[[actuator.monitoring.management-specific-ssl]]
+=== Configuring Management-specific SSL
+When configured to use a custom port, the management server can also be configured with its own SSL by using the various `management.server.ssl.*` properties.
+For example, doing so lets a management server be available over HTTP while the main application uses HTTPS, as shown in the following property settings:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ server:
+ port: 8443
+ ssl:
+ enabled: true
+ key-store: "classpath:store.jks"
+ key-password: secret
+ management:
+ server:
+ port: 8080
+ ssl:
+ enabled: false
+----
+
+Alternatively, both the main server and the management server can use SSL but with different key stores, as follows:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ server:
+ port: 8443
+ ssl:
+ enabled: true
+ key-store: "classpath:main.jks"
+ key-password: "secret"
+ management:
+ server:
+ port: 8080
+ ssl:
+ enabled: true
+ key-store: "classpath:management.jks"
+ key-password: "secret"
+----
+
+
+
+[[actuator.monitoring.customizing-management-server-address]]
+=== Customizing the Management Server Address
+You can customize the address that the management endpoints are available on by setting the configprop:management.server.address[] property.
+Doing so can be useful if you want to listen only on an internal or ops-facing network or to listen only for connections from `localhost`.
+
+NOTE: You can listen on a different address only when the port differs from the main server port.
+
+The following example `application.properties` does not allow remote management connections:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ server:
+ port: 8081
+ address: "127.0.0.1"
+----
+
+
+
+[[actuator.monitoring.disabling-http-endpoints]]
+=== Disabling HTTP Endpoints
+If you do not want to expose endpoints over HTTP, you can set the management port to `-1`, as shown in the following example:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ server:
+ port: -1
+----
+
+This can be achieved using the configprop:management.endpoints.web.exposure.exclude[] property as well, as shown in the following example:
+
+[source,yaml,indent=0,configprops,configblocks]
+----
+ management:
+ endpoints:
+ web:
+ exposure:
+ exclude: "*"
+----
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/process-monitoring.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/process-monitoring.adoc
new file mode 100644
index 0000000000..365d3c1853
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/process-monitoring.adoc
@@ -0,0 +1,31 @@
+[[actuator.process-monitoring]]
+== Process Monitoring
+In the `spring-boot` module, you can find two classes to create files that are often useful for process monitoring:
+
+* `ApplicationPidFileWriter` creates a file containing the application PID (by default, in the application directory with a file name of `application.pid`).
+* `WebServerPortFileWriter` creates a file (or files) containing the ports of the running web server (by default, in the application directory with a file name of `application.port`).
+
+By default, these writers are not activated, but you can enable:
+
+* <>
+* <>
+
+
+
+[[actuator.process-monitoring.configuration]]
+=== Extending Configuration
+In the `META-INF/spring.factories` file, you can activate the listener(s) that writes a PID file, as shown in the following example:
+
+[indent=0]
+----
+ org.springframework.context.ApplicationListener=\
+ org.springframework.boot.context.ApplicationPidFileWriter,\
+ org.springframework.boot.web.context.WebServerPortFileWriter
+----
+
+
+
+[[actuator.process-monitoring.programmatically]]
+=== Programmatically
+You can also activate a listener by invoking the `SpringApplication.addListeners(...)` method and passing the appropriate `Writer` object.
+This method also lets you customize the file name and path in the `Writer` constructor.
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/tracing.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/tracing.adoc
new file mode 100644
index 0000000000..df0adbbdd9
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/tracing.adoc
@@ -0,0 +1,16 @@
+[[actuator.tracing]]
+== HTTP Tracing
+HTTP Tracing can be enabled by providing a bean of type `HttpTraceRepository` in your application's configuration.
+For convenience, Spring Boot offers an `InMemoryHttpTraceRepository` that stores traces for the last 100 request-response exchanges, by default.
+`InMemoryHttpTraceRepository` is limited compared to other tracing solutions and we recommend using it only for development environments.
+For production environments, use of a production-ready tracing or observability solution, such as Zipkin or Spring Cloud Sleuth, is recommended.
+Alternatively, create your own `HttpTraceRepository` that meets your needs.
+
+The `httptrace` endpoint can be used to obtain information about the request-response exchanges that are stored in the `HttpTraceRepository`.
+
+
+
+[[actuator.tracing.custom]]
+=== Custom HTTP tracing
+To customize the items that are included in each trace, use the configprop:management.trace.http.include[] configuration property.
+For advanced customization, consider registering your own `HttpExchangeTracer` implementation.
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/whats-next.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/whats-next.adoc
new file mode 100644
index 0000000000..652c0d147a
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/whats-next.adoc
@@ -0,0 +1,5 @@
+[[actuator.whats-next]]
+== What to Read Next
+You might want to read about graphing tools such as https://graphiteapp.org[Graphite].
+
+Otherwise, you can continue on, to read about <> or jump ahead for some in-depth information about Spring Boot's _<>_.
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/anchor-rewrite.properties b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/anchor-rewrite.properties
index 31ebe7363b..d5d39f2e53 100644
--- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/anchor-rewrite.properties
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/anchor-rewrite.properties
@@ -173,7 +173,7 @@ getting-started.first-application.executable-jar
# 2 == What to Read Next
getting-started-whats-next=\
-getting-started.whats=next
+getting-started.whats-next
@@ -2856,252 +2856,252 @@ howto.testcontainers
# (appendix-application-properties.adoc)
# 1 = Common Application properties
common-application-properties=\
-appendix.common-application-properties
+application-properties
# 2 == Core Properties [[core-properties]]
common-application-properties-core=\
-appendix.common-application-properties.core
+application-properties.core
# 2 == Cache Properties [[cache-properties]]
common-application-properties-cache=\
-appendix.common-application-properties.cache
+application-properties.cache
# 2 == Mail Properties [[mail-properties]]
common-application-properties-mail=\
-appendix.common-application-properties.mail
+application-properties.mail
# 2 == JSON Properties [[json-properties]]
common-application-properties-json=\
-appendix.common-application-properties.json
+application-properties.json
# 2 == Data Properties [[data-properties]]
common-application-properties-data=\
-appendix.common-application-properties.data
+application-properties.data
# 2 == Transaction Properties [[transaction-properties]]
common-application-properties-transaction=\
-appendix.common-application-properties.transaction
+application-properties.transaction
# 2 == Data Migration Properties [[data-migration-properties]]
common-application-properties-data-migration=\
-appendix.common-application-properties.data-migration
+application-properties.data-migration
# 2 == Integration Properties [[integration-properties]]
common-application-properties-integration=\
-appendix.common-application-properties.integration
+application-properties.integration
# 2 == Web Properties [[web-properties]]
common-application-properties-web=\
-appendix.common-application-properties.web
+application-properties.web
# 2 == Templating Properties [[templating-properties]]
common-application-properties-templating=\
-appendix.common-application-properties.templating
+application-properties.templating
# 2 == Server Properties [[server-properties]]
common-application-properties-server=\
-appendix.common-application-properties.server
+application-properties.server
# 2 == Security Properties [[security-properties]]
common-application-properties-security=\
-appendix.common-application-properties.security
+application-properties.security
# 2 == RSocket Properties [[rsocket-properties]]
common-application-properties-rsocket=\
-appendix.common-application-properties.rsocket
+application-properties.rsocket
# 2 == Actuator Properties [[actuator-properties]]
common-application-properties-actuator=\
-appendix.common-application-properties.actuator
+application-properties.actuator
# 2 == Devtools Properties [[devtools-properties]]
common-application-properties-devtools=\
-appendix.common-application-properties.devtools
+application-properties.devtools
# 2 == Testing Properties [[testing-properties]]
common-application-properties-testing=\
-appendix.common-application-properties.testing
+application-properties.testing
# (configuration-metadata.adoc)
# 1 = Configuration Metadata
configuration-metadata=\
-appendix.configuration-metadata
+configuration-metadata
# 2 == Metadata Format
configuration-metadata-format=\
-appendix.configuration-metadata.format
+configuration-metadata.format
# 3 === Group Attributes
configuration-metadata-group-attributes=\
-appendix.configuration-metadata.format.group
+configuration-metadata.format.group
# 3 === Property Attributes
configuration-metadata-property-attributes=\
-appendix.configuration-metadata.format.property
+configuration-metadata.format.property
# 3 === Hint Attributes
configuration-metadata-hints-attributes=\
-appendix.configuration-metadata.format.hints
+configuration-metadata.format.hints
# 3 === Repeated Metadata Items
configuration-metadata-repeated-items=\
-appendix.configuration-metadata.format.repeated-items
+configuration-metadata.format.repeated-items
# 2 == Providing Manual Hints
configuration-metadata-providing-manual-hints=\
-appendix.configuration-metadata.manual-hints
+configuration-metadata.manual-hints
# 3 === Value Hint
configuration-metadata-providing-manual-hints-value-hint=\
-appendix.configuration-metadata.manual-hints.value-hint
+configuration-metadata.manual-hints.value-hint
# 3 === Value Providers
configuration-metadata-providing-manual-hints-value-providers=\
-appendix.configuration-metadata.manual-hints.value-providers
+configuration-metadata.manual-hints.value-providers
# 4 ==== Any
configuration-metadata-providing-manual-hints-any=\
-appendix.configuration-metadata.manual-hints.value-providers.any
+configuration-metadata.manual-hints.value-providers.any
# 4 ==== Class Reference
configuration-metadata-providing-manual-hints-class-reference=\
-appendix.configuration-metadata.manual-hints.value-providers.class-reference
+configuration-metadata.manual-hints.value-providers.class-reference
# 4 ==== Handle As
configuration-metadata-providing-manual-hints-handle-as=\
-appendix.configuration-metadata.manual-hints.value-providers.handle-as
+configuration-metadata.manual-hints.value-providers.handle-as
# 4 ==== Logger Name
configuration-metadata-providing-manual-hints-logger-name=\
-appendix.configuration-metadata.manual-hints.value-providers.logger-name
+configuration-metadata.manual-hints.value-providers.logger-name
# 4 ==== Spring Bean Reference
configuration-metadata-providing-manual-hints-spring-bean-reference=\
-appendix.configuration-metadata.manual-hints.value-providers.spring-bean-reference
+configuration-metadata.manual-hints.value-providers.spring-bean-reference
# 4 ==== Spring Profile Name
configuration-metadata-providing-manual-hints-spring-profile-name=\
-appendix.configuration-metadata.manual-hints.value-providers.spring-profile-name
+configuration-metadata.manual-hints.value-providers.spring-profile-name
# 2 == Generating Your Own Metadata by Using the Annotation Processor
configuration-metadata-annotation-processor=\
-appendix.configuration-metadata.annotation-processor
+configuration-metadata.annotation-processor
# 3 === Configuring the Annotation Processor
configuration-metadata-annotation-processor-setup=\
-appendix.configuration-metadata.annotation-processor.configuring
+configuration-metadata.annotation-processor.configuring
# 3 === Automatic Metadata Generation
configuration-metadata-annotation-processor-metadata-generation=\
-appendix.configuration-metadata.annotation-processor.automatic-metadata-generation
+configuration-metadata.annotation-processor.automatic-metadata-generation
# 4 ==== Nested Properties
configuration-metadata-annotation-processor-metadata-generation-nested=\
-appendix.configuration-metadata.annotation-processor.automatic-metadata-generation.nested-properties
+configuration-metadata.annotation-processor.automatic-metadata-generation.nested-properties
# 3 === Adding Additional Metadata
configuration-metadata-additional-metadata=\
-appendix.configuration-metadata.annotation-processor.adding-additional-metadata
+configuration-metadata.annotation-processor.adding-additional-metadata
# (auto-configuration-classes.adoc)
# 1 = Auto-configuration Classes
auto-configuration-classes=\
-appendix.auto-configuration-classes
+auto-configuration-classes
# 2 == spring-boot-autoconfigure
auto-configuration-classes-from-autoconfigure-module=\
-appendix.auto-configuration-classes.core
+auto-configuration-classes.core
# 2 == spring-boot-actuator-autoconfigure
auto-configuration-classes-from-actuator=\
-appendix.auto-configuration-classes.actuator
+auto-configuration-classes.actuator
# (test-auto-configuration.adoc)
# 1 = Test Auto-configuration Annotations
test-auto-configuration=\
-appendix.test-auto-configuration
+test-auto-configuration
# 2 == Test Slices
test-auto-configuration-slices=\
-appendix.test-auto-configuration.slices
+test-auto-configuration.slices
# (executable-jar.adoc)
# 1 = The Executable Jar Format
executable-jar=\
-appendix.executable-jar
+executable-jar
# 2 == Nested JARs
executable-jar-nested-jars=\
-appendix.executable-jar.nested-jars
+executable-jar.nested-jars
# 3 === The Executable Jar File Structure
executable-jar-jar-file-structure=\
-appendix.executable-jar.nested-jars.jar-structure
+executable-jar.nested-jars.jar-structure
# 3 === The Executable War File Structure
executable-jar-war-file-structure=\
-appendix.executable-jar.nested-jars.war-structure
+executable-jar.nested-jars.war-structure
# 3 === Index Files
executable-jar-war-index-files=\
-appendix.executable-jar.nested-jars.index-files
+executable-jar.nested-jars.index-files
# 3 === Classpath Index
executable-jar-war-index-files-classpath=\
-appendix.executable-jar.nested-jars.classpath-index
+executable-jar.nested-jars.classpath-index
# 3 === Layer Index
executable-jar-war-index-files-layers=\
-appendix.executable-jar.nested-jars.layer-index
+executable-jar.nested-jars.layer-index
# 2 == Spring Boot's "`JarFile`" Class
executable-jar-jarfile=\
-appendix.executable-jar.jarfile-class
+executable-jar.jarfile-class
# 3 === Compatibility with the Standard Java "`JarFile`"
executable-jar-jarfile-compatibility=\
-appendix.executable-jar.jarfile-class.compatibilty
+executable-jar.jarfile-class.compatibilty
# 2 == Launching Executable Jars
executable-jar-launching=\
-appendix.executable-jar.launching
+executable-jar.launching
# 3 === Launcher Manifest
executable-jar-launcher-manifest=\
-appendix.executable-jar.launching.manifest
+executable-jar.launching.manifest
# 2 == PropertiesLauncher Features
executable-jar-property-launcher-features=\
-appendix.executable-jar.property-launcher
+executable-jar.property-launcher
# 2 == Executable Jar Restrictions
executable-jar-restrictions=\
-appendix.executable-jar.restrictions
+executable-jar.restrictions
# 2 == Alternative Single Jar Solutions
executable-jar-alternatives=\
-appendix.executable-jar.alternatives
+executable-jar.alternatives
# (dependency-versions.adoc)
# 1 = Dependency versions
dependency-versions=\
-appendix.dependency-versions
+dependency-versions
# 2 == Managed Dependency Coordinates
dependency-versions-coordinates=\
-appendix.dependency-versions.coordinates
+dependency-versions.coordinates
# 2 == Version Properties
dependency-versions-properties=\
-appendix.dependency-versions.properties
+dependency-versions.properties
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties.adoc
new file mode 100644
index 0000000000..7a9710ecf9
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties.adoc
@@ -0,0 +1,48 @@
+[appendix]
+[[application-properties]]
+= Common Application properties
+include::attributes.adoc[]
+
+
+
+Various properties can be specified inside your `application.properties` file, inside your `application.yml` file, or as command line switches.
+This appendix provides a list of common Spring Boot properties and references to the underlying classes that consume them.
+
+TIP: Spring Boot provides various conversion mechanism with advanced value formatting, make sure to review <>.
+
+NOTE: Property contributions can come from additional jar files on your classpath, so you should not consider this an exhaustive list.
+Also, you can define your own properties.
+
+
+
+include::application-properties/core.adoc[]
+
+include::application-properties/cache.adoc[]
+
+include::application-properties/mail.adoc[]
+
+include::application-properties/json.adoc[]
+
+include::application-properties/data.adoc[]
+
+include::application-properties/transaction.adoc[]
+
+include::application-properties/data-migration.adoc[]
+
+include::application-properties/integration.adoc[]
+
+include::application-properties/web.adoc[]
+
+include::application-properties/templating.adoc[]
+
+include::application-properties/server.adoc[]
+
+include::application-properties/security.adoc[]
+
+include::application-properties/rsocket.adoc[]
+
+include::application-properties/actuator.adoc[]
+
+include::application-properties/devtools.adoc[]
+
+include::application-properties/testing.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/actuator.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/actuator.adoc
new file mode 100644
index 0000000000..3839fe3fde
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/actuator.adoc
@@ -0,0 +1,3 @@
+[[application-properties.actuator]]
+== Actuator Properties [[actuator-properties]]
+include::documented-application-properties/actuator.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/cache.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/cache.adoc
new file mode 100644
index 0000000000..b7b94177a3
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/cache.adoc
@@ -0,0 +1,3 @@
+[[application-properties.cache]]
+== Cache Properties [[cache-properties]]
+include::documented-application-properties/cache.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/core.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/core.adoc
new file mode 100644
index 0000000000..53e5caef77
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/core.adoc
@@ -0,0 +1,3 @@
+[[application-properties.core]]
+== Core Properties [[core-properties]]
+include::documented-application-properties/core.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/data-migration.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/data-migration.adoc
new file mode 100644
index 0000000000..892b5b41e1
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/data-migration.adoc
@@ -0,0 +1,3 @@
+[[application-properties.data-migration]]
+== Data Migration Properties [[data-migration-properties]]
+include::documented-application-properties/data-migration.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/data.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/data.adoc
new file mode 100644
index 0000000000..ce85689133
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/data.adoc
@@ -0,0 +1,3 @@
+[[application-properties.data]]
+== Data Properties [[data-properties]]
+include::documented-application-properties/data.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/devtools.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/devtools.adoc
new file mode 100644
index 0000000000..4a6966aeb9
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/devtools.adoc
@@ -0,0 +1,3 @@
+[[application-properties.devtools]]
+== Devtools Properties [[devtools-properties]]
+include::documented-application-properties/devtools.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/integration.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/integration.adoc
new file mode 100644
index 0000000000..409416e23c
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/integration.adoc
@@ -0,0 +1,3 @@
+[[application-properties.integration]]
+== Integration Properties [[integration-properties]]
+include::documented-application-properties/integration.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/json.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/json.adoc
new file mode 100644
index 0000000000..5ae84a1874
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/json.adoc
@@ -0,0 +1,3 @@
+[[application-properties.json]]
+== JSON Properties [[json-properties]]
+include::documented-application-properties/json.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/mail.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/mail.adoc
new file mode 100644
index 0000000000..8c93a6d828
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/mail.adoc
@@ -0,0 +1,3 @@
+[[application-properties.mail]]
+== Mail Properties [[mail-properties]]
+include::documented-application-properties/mail.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/rsocket.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/rsocket.adoc
new file mode 100644
index 0000000000..4c83b0bd26
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/rsocket.adoc
@@ -0,0 +1,3 @@
+[[application-properties.rsocket]]
+== RSocket Properties [[rsocket-properties]]
+include::documented-application-properties/rsocket.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/security.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/security.adoc
new file mode 100644
index 0000000000..8d20e4e49b
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/security.adoc
@@ -0,0 +1,3 @@
+[[application-properties.security]]
+== Security Properties [[security-properties]]
+include::documented-application-properties/security.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/server.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/server.adoc
new file mode 100644
index 0000000000..0302e18819
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/server.adoc
@@ -0,0 +1,3 @@
+[[application-properties.server]]
+== Server Properties [[server-properties]]
+include::documented-application-properties/server.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/templating.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/templating.adoc
new file mode 100644
index 0000000000..cc6fdea198
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/templating.adoc
@@ -0,0 +1,3 @@
+[[application-properties.templating]]
+== Templating Properties [[templating-properties]]
+include::documented-application-properties/templating.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/testing.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/testing.adoc
new file mode 100644
index 0000000000..bb5b918f97
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/testing.adoc
@@ -0,0 +1,3 @@
+[[application-properties.testing]]
+== Testing Properties [[testing-properties]]
+include::documented-application-properties/testing.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/transaction.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/transaction.adoc
new file mode 100644
index 0000000000..7c5cb71348
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/transaction.adoc
@@ -0,0 +1,3 @@
+[[application-properties.transaction]]
+== Transaction Properties [[transaction-properties]]
+include::documented-application-properties/transaction.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/web.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/web.adoc
new file mode 100644
index 0000000000..f9567ca2c4
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/application-properties/web.adoc
@@ -0,0 +1,3 @@
+[[application-properties.web]]
+== Web Properties [[web-properties]]
+include::documented-application-properties/web.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc
index 82665fb8c1..c6bf2e4609 100644
--- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc
@@ -10,21 +10,17 @@
:hide-uri-scheme:
:docinfo: shared,private
:chomp: tags formatters headers packages
-
:spring-boot-artifactory-repo: snapshot
:github-tag: main
:spring-boot-version: current
-
:github-repo: spring-projects/spring-boot
:github-raw: https://raw.githubusercontent.com/{github-repo}/{github-tag}
:github-issues: https://github.com/{github-repo}/issues/
:github-wiki: https://github.com/{github-repo}/wiki
-
-:include: ../main/java/org/springframework/boot/docs
+:include: ../../main/java/org/springframework/boot/docs
:include-springbootfeatures: {include}/springbootfeatures
:include-productionreadyfeatures: {include}/productionreadyfeatures
:include-howto: {include}/howto
-
: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
@@ -38,7 +34,6 @@
:spring-boot-gradle-plugin-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/gradle-plugin/reference/htmlsingle/
: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/api/
-
: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
@@ -55,7 +50,6 @@
: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/{spring-amqp-version}/api/org/springframework/amqp
:spring-batch: https://spring.io/projects/spring-batch
:spring-batch-api: https://docs.spring.io/spring-batch/docs/{spring-batch-version}/api/org/springframework/batch
@@ -94,7 +88,6 @@
:spring-security-oauth2-docs: https://projects.spring.io/spring-security-oauth/docs/oauth2.html
:spring-session: https://spring.io/projects/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/current/userguide
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/auto-configuration-classes.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/auto-configuration-classes.adoc
index 2be9668ad8..c0d586a076 100644
--- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/auto-configuration-classes.adoc
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/auto-configuration-classes.adoc
@@ -1,24 +1,16 @@
[appendix]
-[[appendix.auto-configuration-classes]]
+[[auto-configuration-classes]]
= Auto-configuration Classes
include::attributes.adoc[]
+
+
This appendix contains details of all of the auto-configuration classes provided by Spring Boot, with links to documentation and source code.
Remember to also look at the conditions report in your application for more details of which features are switched on.
(To do so, start the app with `--debug` or `-Ddebug` or, in an Actuator application, use the `conditions` endpoint).
-[[appendix.auto-configuration-classes.core]]
-== spring-boot-autoconfigure
-The following auto-configuration classes are from the `spring-boot-autoconfigure` module:
+include::auto-configuration-classes/core.adoc[]
-include::auto-configuration-classes/spring-boot-autoconfigure.adoc[]
-
-
-
-[[appendix.auto-configuration-classes.actuator]]
-== spring-boot-actuator-autoconfigure
-The following auto-configuration classes are from the `spring-boot-actuator-autoconfigure` module:
-
-include::auto-configuration-classes/spring-boot-actuator-autoconfigure.adoc[]
+include::auto-configuration-classes/actuator.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/auto-configuration-classes/actuator.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/auto-configuration-classes/actuator.adoc
new file mode 100644
index 0000000000..4403ec3da3
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/auto-configuration-classes/actuator.adoc
@@ -0,0 +1,5 @@
+[[auto-configuration-classes.actuator]]
+== spring-boot-actuator-autoconfigure
+The following auto-configuration classes are from the `spring-boot-actuator-autoconfigure` module:
+
+include::documented-auto-configuration-classes/spring-boot-actuator-autoconfigure.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/auto-configuration-classes/core.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/auto-configuration-classes/core.adoc
new file mode 100644
index 0000000000..eb9c201c88
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/auto-configuration-classes/core.adoc
@@ -0,0 +1,5 @@
+[[auto-configuration-classes.core]]
+== spring-boot-autoconfigure
+The following auto-configuration classes are from the `spring-boot-autoconfigure` module:
+
+include::documented-auto-configuration-classes/spring-boot-autoconfigure.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins.adoc
index b2ffec82a3..1fff3b6bf0 100644
--- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins.adoc
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins.adoc
@@ -2,244 +2,21 @@
= Build Tool Plugins
include::attributes.adoc[]
+
+
Spring Boot provides build tool plugins for Maven and Gradle.
The plugins offer a variety of features, including the packaging of executable jars.
This section provides more details on both plugins as well as some help should you need to extend an unsupported build system.
-If you are just getting started, you might want to read "`<>`" from the "`<>`" section first.
+If you are just getting started, you might want to read "`<>`" from the "`<>`" section first.
-[[build-tool-plugins.maven]]
-== Spring Boot Maven Plugin
-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).
+include::build-tool-plugins/maven.adoc[]
-Please refer to the plugin's documentation to learn more:
+include::build-tool-plugins/gradle.adoc[]
-* Reference ({spring-boot-maven-plugin-docs}[HTML] and {spring-boot-maven-plugin-pdfdocs}[PDF])
-* {spring-boot-maven-plugin-api}[API]
+include::build-tool-plugins/antlib.adoc[]
+include::build-tool-plugins/other-build-systems.adoc[]
-
-[[build-tool-plugins.gradle]]
-== Spring Boot Gradle Plugin
-The Spring Boot Gradle Plugin provides Spring Boot support in Gradle, letting you package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`.
-It requires Gradle 6.8 or 7.x.
-Please refer to the plugin's documentation to learn more:
-
-* Reference ({spring-boot-gradle-plugin-docs}[HTML] and {spring-boot-gradle-plugin-pdfdocs}[PDF])
-* {spring-boot-gradle-plugin-api}[API]
-
-
-
-[[build-tool-plugins.antlib]]
-== Spring Boot AntLib Module
-The Spring Boot AntLib module provides basic Spring Boot support for Apache Ant.
-You can use the module to create executable jars.
-To use the module, you need to declare an additional `spring-boot` namespace in your `build.xml`, as shown in the following example:
-
-[source,xml,indent=0]
-----
-
- ...
-
-----
-
-You need to remember to start Ant using the `-lib` option, as shown in the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ ant -lib
-----
-
-TIP: The "`Using Spring Boot`" section includes a more complete example of <>.
-
-
-
-[[build-tool-plugins.antlib.tasks]]
-=== Spring Boot Ant Tasks
-Once the `spring-boot-antlib` namespace has been declared, the following additional tasks are available:
-
-* <>
-* <>
-
-
-
-[[build-tool-plugins.antlib.tasks.exejar]]
-==== Using the "`exejar`" Task
-You can use the `exejar` task to create a Spring Boot executable jar.
-The following attributes are supported by the task:
-
-[cols="1,2,2"]
-|====
-| Attribute | Description | Required
-
-| `destfile`
-| The destination jar file to create
-| Yes
-
-| `classes`
-| The root directory of Java class files
-| Yes
-
-| `start-class`
-| The main application class to run
-| No _(the default is the first class found that declares a `main` method)_
-|====
-
-The following nested elements can be used with the task:
-
-[cols="1,4"]
-|====
-| Element | Description
-
-| `resources`
-| 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-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.
-|====
-
-
-
-[[build-tool-plugins.antlib.tasks.examples]]
-==== Examples
-This section shows two examples of Ant tasks.
-
-.Specify +start-class+
-[source,xml,indent=0]
-----
-
-
-
-
-
-
-
-
-----
-
-.Detect +start-class+
-[source,xml,indent=0]
-----
-
-
-
-
-
-----
-
-
-
-[[build-tool-plugins.antlib.findmainclass]]
-=== Using the "`findmainclass`" Task
-The `findmainclass` task is used internally by `exejar` to locate a class declaring a `main`.
-If necessary, you can also use this task directly in your build.
-The following attributes are supported:
-
-[cols="1,2,2"]
-|====
-| Attribute | Description | Required
-
-| `classesroot`
-| The root directory of Java class files
-| Yes _(unless `mainclass` is specified)_
-
-| `mainclass`
-| Can be used to short-circuit the `main` class search
-| No
-
-| `property`
-| The Ant property that should be set with the result
-| No _(result will be logged if unspecified)_
-|====
-
-
-
-[[build-tool-plugins.antlib.findmainclass.examples]]
-==== Examples
-This section contains three examples of using `findmainclass`.
-
-.Find and log
-[source,xml,indent=0]
-----
-
-----
-
-.Find and set
-[source,xml,indent=0]
-----
-
-----
-
-.Override and set
-[source,xml,indent=0]
-----
-
-----
-
-
-
-[[build-tool-plugins.other-build-systems]]
-== Supporting Other Build Systems
-If you want to use a build tool other than Maven, Gradle, or Ant, you likely need to develop your own plugin.
-Executable jars need to follow a specific format and certain entries need to be written in an uncompressed form (see the "`<>`" section in the appendix for details).
-
-The Spring Boot Maven and Gradle plugins both make use of `spring-boot-loader-tools` to actually generate jars.
-If you need to, you may use this library directly.
-
-
-
-[[build-tool-plugins.other-build-systems.repackaging-archives]]
-=== Repackaging Archives
-To repackage an existing archive so that it becomes a self-contained executable archive, use `org.springframework.boot.loader.tools.Repackager`.
-The `Repackager` class takes a single constructor argument that refers to an existing jar or war archive.
-Use one of the two available `repackage()` methods to either replace the original file or write to a new destination.
-Various settings can also be configured on the repackager before it is run.
-
-
-
-[[build-tool-plugins.other-build-systems.nested-libraries]]
-=== Nested Libraries
-When repackaging an archive, you can include references to dependency files by using the `org.springframework.boot.loader.tools.Libraries` interface.
-We do not provide any concrete implementations of `Libraries` here as they are usually build-system-specific.
-
-If your archive already includes libraries, you can use `Libraries.NONE`.
-
-
-
-[[build-tool-plugins.other-build-systems.finding-main-class]]
-=== Finding a Main Class
-If you do not use `Repackager.setMainClass()` to specify a main class, the repackager uses https://asm.ow2.io/[ASM] to read class files and tries to find a suitable class with a `public static void main(String[] args)` method.
-An exception is thrown if more than one candidate is found.
-
-
-
-[[build-tool-plugins.other-build-systems.example-repackage-implementation]]
-=== Example Repackage Implementation
-The following example shows a typical repackage implementation:
-
-[source,java,pending-extract=true,indent=0]
-----
- Repackager repackager = new Repackager(sourceJarFile);
- repackager.setBackupSource(false);
- repackager.repackage(new Libraries() {
- @Override
- public void doWithLibraries(LibraryCallback callback) throws IOException {
- // Build system specific implementation, callback for each dependency
- // callback.library(new Library(nestedFile, LibraryScope.COMPILE));
- }
- });
-----
-
-
-
-[[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 {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 <>.
-
-If you have specific build-related questions, you can check out the "`<>`" guides.
+include::build-tool-plugins/whats-next.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/antlib.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/antlib.adoc
new file mode 100644
index 0000000000..2187652855
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/antlib.adoc
@@ -0,0 +1,148 @@
+[[build-tool-plugins.antlib]]
+== Spring Boot AntLib Module
+The Spring Boot AntLib module provides basic Spring Boot support for Apache Ant.
+You can use the module to create executable jars.
+To use the module, you need to declare an additional `spring-boot` namespace in your `build.xml`, as shown in the following example:
+
+[source,xml,indent=0]
+----
+
+ ...
+
+----
+
+You need to remember to start Ant using the `-lib` option, as shown in the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ ant -lib
+----
+
+TIP: The "`Using Spring Boot`" section includes a more complete example of <>.
+
+
+
+[[build-tool-plugins.antlib.tasks]]
+=== Spring Boot Ant Tasks
+Once the `spring-boot-antlib` namespace has been declared, the following additional tasks are available:
+
+* <>
+* <>
+
+
+
+[[build-tool-plugins.antlib.tasks.exejar]]
+==== Using the "`exejar`" Task
+You can use the `exejar` task to create a Spring Boot executable jar.
+The following attributes are supported by the task:
+
+[cols="1,2,2"]
+|====
+| Attribute | Description | Required
+
+| `destfile`
+| The destination jar file to create
+| Yes
+
+| `classes`
+| The root directory of Java class files
+| Yes
+
+| `start-class`
+| The main application class to run
+| No _(the default is the first class found that declares a `main` method)_
+|====
+
+The following nested elements can be used with the task:
+
+[cols="1,4"]
+|====
+| Element | Description
+
+| `resources`
+| 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-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.
+|====
+
+
+
+[[build-tool-plugins.antlib.tasks.examples]]
+==== Examples
+This section shows two examples of Ant tasks.
+
+.Specify +start-class+
+[source,xml,indent=0]
+----
+
+
+
+
+
+
+
+
+----
+
+.Detect +start-class+
+[source,xml,indent=0]
+----
+
+
+
+
+
+----
+
+
+
+[[build-tool-plugins.antlib.findmainclass]]
+=== Using the "`findmainclass`" Task
+The `findmainclass` task is used internally by `exejar` to locate a class declaring a `main`.
+If necessary, you can also use this task directly in your build.
+The following attributes are supported:
+
+[cols="1,2,2"]
+|====
+| Attribute | Description | Required
+
+| `classesroot`
+| The root directory of Java class files
+| Yes _(unless `mainclass` is specified)_
+
+| `mainclass`
+| Can be used to short-circuit the `main` class search
+| No
+
+| `property`
+| The Ant property that should be set with the result
+| No _(result will be logged if unspecified)_
+|====
+
+
+
+[[build-tool-plugins.antlib.findmainclass.examples]]
+==== Examples
+This section contains three examples of using `findmainclass`.
+
+.Find and log
+[source,xml,indent=0]
+----
+
+----
+
+.Find and set
+[source,xml,indent=0]
+----
+
+----
+
+.Override and set
+[source,xml,indent=0]
+----
+
+----
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/gradle.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/gradle.adoc
new file mode 100644
index 0000000000..4d9065c13b
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/gradle.adoc
@@ -0,0 +1,8 @@
+[[build-tool-plugins.gradle]]
+== Spring Boot Gradle Plugin
+The Spring Boot Gradle Plugin provides Spring Boot support in Gradle, letting you package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`.
+It requires Gradle 6.8 or 7.x.
+Please refer to the plugin's documentation to learn more:
+
+* Reference ({spring-boot-gradle-plugin-docs}[HTML] and {spring-boot-gradle-plugin-pdfdocs}[PDF])
+* {spring-boot-gradle-plugin-api}[API]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/maven.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/maven.adoc
new file mode 100644
index 0000000000..452f039101
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/maven.adoc
@@ -0,0 +1,9 @@
+[[build-tool-plugins.maven]]
+== Spring Boot Maven Plugin
+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).
+
+Please refer to the plugin's documentation to learn more:
+
+* Reference ({spring-boot-maven-plugin-docs}[HTML] and {spring-boot-maven-plugin-pdfdocs}[PDF])
+* {spring-boot-maven-plugin-api}[API]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/other-build-systems.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/other-build-systems.adoc
new file mode 100644
index 0000000000..30295b63d1
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/other-build-systems.adoc
@@ -0,0 +1,51 @@
+[[build-tool-plugins.other-build-systems]]
+== Supporting Other Build Systems
+If you want to use a build tool other than Maven, Gradle, or Ant, you likely need to develop your own plugin.
+Executable jars need to follow a specific format and certain entries need to be written in an uncompressed form (see the "`<>`" section in the appendix for details).
+
+The Spring Boot Maven and Gradle plugins both make use of `spring-boot-loader-tools` to actually generate jars.
+If you need to, you may use this library directly.
+
+
+
+[[build-tool-plugins.other-build-systems.repackaging-archives]]
+=== Repackaging Archives
+To repackage an existing archive so that it becomes a self-contained executable archive, use `org.springframework.boot.loader.tools.Repackager`.
+The `Repackager` class takes a single constructor argument that refers to an existing jar or war archive.
+Use one of the two available `repackage()` methods to either replace the original file or write to a new destination.
+Various settings can also be configured on the repackager before it is run.
+
+
+
+[[build-tool-plugins.other-build-systems.nested-libraries]]
+=== Nested Libraries
+When repackaging an archive, you can include references to dependency files by using the `org.springframework.boot.loader.tools.Libraries` interface.
+We do not provide any concrete implementations of `Libraries` here as they are usually build-system-specific.
+
+If your archive already includes libraries, you can use `Libraries.NONE`.
+
+
+
+[[build-tool-plugins.other-build-systems.finding-main-class]]
+=== Finding a Main Class
+If you do not use `Repackager.setMainClass()` to specify a main class, the repackager uses https://asm.ow2.io/[ASM] to read class files and tries to find a suitable class with a `public static void main(String[] args)` method.
+An exception is thrown if more than one candidate is found.
+
+
+
+[[build-tool-plugins.other-build-systems.example-repackage-implementation]]
+=== Example Repackage Implementation
+The following example shows a typical repackage implementation:
+
+[source,java,pending-extract=true,indent=0]
+----
+ Repackager repackager = new Repackager(sourceJarFile);
+ repackager.setBackupSource(false);
+ repackager.repackage(new Libraries() {
+ @Override
+ public void doWithLibraries(LibraryCallback callback) throws IOException {
+ // Build system specific implementation, callback for each dependency
+ // callback.library(new Library(nestedFile, LibraryScope.COMPILE));
+ }
+ });
+----
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/whats-next.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/whats-next.adoc
new file mode 100644
index 0000000000..ed22fc2e9c
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins/whats-next.adoc
@@ -0,0 +1,6 @@
+[[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 {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 <>.
+
+If you have specific build-related questions, you can check out the "`<>`" guides.
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli.adoc
index 61b3a7c638..e573303d9c 100644
--- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli.adoc
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli.adoc
@@ -2,434 +2,19 @@
= Spring Boot CLI
include::attributes.adoc[]
+
The Spring Boot CLI is a command line tool that you can use if you want to quickly develop a Spring application.
It lets you run Groovy scripts, which means that you have a familiar Java-like syntax without so much boilerplate code.
You can also bootstrap a new project or write your own command for it.
-[[cli.installation]]
-== Installing the CLI
-The Spring Boot CLI (Command-Line Interface) can be installed manually by using SDKMAN! (the SDK Manager) or by using Homebrew or MacPorts if you are an OSX user.
-See _<>_ in the "`Getting started`" section for comprehensive installation instructions.
+include::cli/installation.adoc[]
+include::cli/using-the-cli.adoc[]
+include::cli/groovy-beans-dsl.adoc[]
-[[cli.using-the-cli]]
-== Using the CLI
-Once you have installed the CLI, you can run it by typing `spring` and pressing Enter at the command line.
-If you run `spring` without any arguments, a help screen is displayed, as follows:
+include::cli/maven-setting.adoc[]
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ spring
- usage: spring [--help] [--version]
- []
-
- Available commands are:
-
- run [options] [--] [args]
- Run a spring groovy script
-
- _... more command help is shown here_
-----
-
-You can type `spring help` to get more details about any of the supported commands, as shown in the following example:
-
-[indent=0]
-----
- $ spring help run
- spring run - Run a spring groovy script
-
- usage: spring run [options] [--] [args]
-
- Option Description
- ------ -----------
- --autoconfigure [Boolean] Add autoconfigure compiler
- transformations (default: true)
- --classpath, -cp Additional classpath entries
- --no-guess-dependencies Do not attempt to guess dependencies
- --no-guess-imports Do not attempt to guess imports
- -q, --quiet Quiet logging
- -v, --verbose Verbose logging of dependency
- resolution
- --watch Watch the specified file for changes
-----
-
-The `version` command provides a quick way to check which version of Spring Boot you are using, as follows:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ spring version
- Spring CLI v{spring-boot-version}
-----
-
-
-
-[[cli.using-the-cli.run]]
-=== Running Applications with the CLI
-You can compile and run Groovy source code by using the `run` command.
-The Spring Boot CLI is completely self-contained, so you do not need any external Groovy installation.
-
-The following example shows a "`hello world`" web application written in Groovy:
-
-.hello.groovy
-[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
-----
- @RestController
- class WebApplication {
-
- @RequestMapping("/")
- String home() {
- "Hello World!"
- }
-
- }
-----
-
-To compile and run the application, type the following command:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ spring run hello.groovy
-----
-
-To pass command-line arguments to the application, use `--` to separate the commands from the "`spring`" command arguments, as shown in the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ spring run hello.groovy -- --server.port=9000
-----
-
-To set JVM command line arguments, you can use the `JAVA_OPTS` environment variable, as shown in the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ JAVA_OPTS=-Xmx1024m spring run hello.groovy
-----
-
-NOTE: When setting `JAVA_OPTS` on Microsoft Windows, make sure to quote the entire instruction, such as `set "JAVA_OPTS=-Xms256m -Xmx2048m"`.
-Doing so ensures the values are properly passed to the process.
-
-
-
-[[cli.using-the-cli.run.deduced-grab-annotations]]
-==== Deduced "`grab`" Dependencies
-Standard Groovy includes a `@Grab` annotation, which lets you declare dependencies on third-party libraries.
-This useful technique lets Groovy download jars in the same way as Maven or Gradle would but without requiring you to use a build tool.
-
-Spring Boot extends this technique further and tries to deduce which libraries to "`grab`" based on your code.
-For example, since the `WebApplication` code shown previously uses `@RestController` annotations, Spring Boot grabs "Tomcat" and "Spring MVC".
-
-The following items are used as "`grab hints`":
-
-|===
-| Items | Grabs
-
-| `JdbcTemplate`, `NamedParameterJdbcTemplate`, `DataSource`
-| JDBC Application.
-
-| `@EnableJms`
-| JMS Application.
-
-| `@EnableCaching`
-| Caching abstraction.
-
-| `@Test`
-| JUnit.
-
-| `@EnableRabbit`
-| RabbitMQ.
-
-| extends `Specification`
-| Spock test.
-
-| `@EnableBatchProcessing`
-| Spring Batch.
-
-| `@MessageEndpoint` `@EnableIntegration`
-| Spring Integration.
-
-| `@Controller` `@RestController` `@EnableWebMvc`
-| Spring MVC + Embedded Tomcat.
-
-| `@EnableWebSecurity`
-| Spring Security.
-
-| `@EnableTransactionManagement`
-| Spring Transaction Management.
-|===
-
-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.
-
-
-
-[[cli.using-the-cli.run.deduced-grab-coordinates]]
-==== Deduced "`grab`" Coordinates
-Spring Boot extends Groovy's standard `@Grab` support by letting you specify a dependency without a group or version (for example, `@Grab('freemarker')`).
-Doing so consults Spring Boot's default dependency metadata to deduce the artifact's group and version.
-
-NOTE: The default metadata is tied to the version of the CLI that you use.
-It changes only when you move to a new version of the CLI, putting you in control of when the versions of your dependencies may change.
-A table showing the dependencies and their versions that are included in the default metadata can be found in the <>.
-
-
-
-[[cli.using-the-cli.run.default-import-statements]]
-==== Default Import Statements
-To help reduce the size of your Groovy code, several `import` statements are automatically included.
-Notice how the preceding example refers to `@Component`, `@RestController`, and `@RequestMapping` without needing to use fully-qualified names or `import` statements.
-
-TIP: Many Spring annotations work without using `import` statements.
-Try running your application to see what fails before adding imports.
-
-
-
-[[cli.using-the-cli.run.automatic-main-method]]
-==== Automatic Main Method
-Unlike the equivalent Java application, you do not need to include a `public static void main(String[] args)` method with your `Groovy` scripts.
-A `SpringApplication` is automatically created, with your compiled code acting as the `source`.
-
-
-
-[[cli.using-the-cli.run.custom-dependency-management]]
-==== Custom Dependency Management
-By default, the CLI uses the dependency management declared in `spring-boot-dependencies` when resolving `@Grab` dependencies.
-Additional dependency management, which overrides the default dependency management, can be configured by using the `@DependencyManagementBom` annotation.
-The annotation's value should specify the coordinates (`groupId:artifactId:version`) of one or more Maven BOMs.
-
-For example, consider the following declaration:
-
-[source,groovy,indent=0]
-----
- @DependencyManagementBom("com.example.custom-bom:1.0.0")
-----
-
-The preceding declaration picks up `custom-bom-1.0.0.pom` in a Maven repository under `com/example/custom-versions/1.0.0/`.
-
-When you specify multiple BOMs, they are applied in the order in which you declare them, as shown in the following example:
-
-[source,java,pending-extract=true,indent=0]
-----
- @DependencyManagementBom(["com.example.custom-bom:1.0.0",
- "com.example.another-bom:1.0.0"])
-----
-
-The preceding example indicates that the dependency management in `another-bom` overrides the dependency management in `custom-bom`.
-
-You can use `@DependencyManagementBom` anywhere that you can use `@Grab`.
-However, to ensure consistent ordering of the dependency management, you can use `@DependencyManagementBom` at most once in your application.
-
-
-
-[[cli.using-the-cli.multiple-source-files]]
-=== Applications with Multiple Source Files
-You can use "`shell globbing`" with all commands that accept file input.
-Doing so lets you use multiple files from a single directory, as shown in the following example:
-
-[indent=0]
-----
- $ spring run *.groovy
-----
-
-
-
-[[cli.using-the-cli.packaging]]
-=== Packaging Your Application
-You can use the `jar` command to package your application into a self-contained executable jar file, as shown in the following example:
-
-[indent=0]
-----
- $ spring jar my-app.jar *.groovy
-----
-
-The resulting jar contains the classes produced by compiling the application and all of the application's dependencies so that it can then be run by using `java -jar`.
-The jar file also contains entries from the application's classpath.
-You can add and remove explicit paths to the jar by using `--include` and `--exclude`.
-Both are comma-separated, and both accept prefixes, in the form of "`+`" and "`-`", to signify that they should be removed from the defaults.
-The default includes are as follows:
-
-[indent=0]
-----
- public/**, resources/**, static/**, templates/**, META-INF/**, *
-----
-
-The default excludes are as follows:
-
-[indent=0]
-----
- .*, repository/**, build/**, target/**, **/*.jar, **/*.groovy
-----
-
-Type `spring help jar` on the command line for more information.
-
-
-
-[[cli.using-the-cli.initialize-new-project]]
-=== Initialize a New Project
-The `init` command lets you create a new project by using https://start.spring.io without leaving the shell, as shown in the following example:
-
-[indent=0]
-----
- $ spring init --dependencies=web,data-jpa my-project
- Using service at https://start.spring.io
- Project extracted to '/Users/developer/example/my-project'
-----
-
-The preceding example creates a `my-project` directory with a Maven-based project that uses `spring-boot-starter-web` and `spring-boot-starter-data-jpa`.
-You can list the capabilities of the service by using the `--list` flag, as shown in the following example:
-
-[indent=0]
-----
- $ spring init --list
- =======================================
- Capabilities of https://start.spring.io
- =======================================
-
- Available dependencies:
- -----------------------
- actuator - Actuator: Production ready features to help you monitor and manage your application
- ...
- web - Web: Support for full-stack web development, including Tomcat and spring-webmvc
- websocket - Websocket: Support for WebSocket development
- ws - WS: Support for Spring Web Services
-
- Available project types:
- ------------------------
- gradle-build - Gradle Config [format:build, build:gradle]
- gradle-project - Gradle Project [format:project, build:gradle]
- maven-build - Maven POM [format:build, build:maven]
- maven-project - Maven Project [format:project, build:maven] (default)
-
- ...
-----
-
-The `init` command supports many options.
-See the `help` output for more details.
-For instance, the following command creates a Gradle project that uses Java 8 and `war` packaging:
-
-[indent=0]
-----
- $ spring init --build=gradle --java-version=1.8 --dependencies=websocket --packaging=war sample-app.zip
- Using service at https://start.spring.io
- Content saved to 'sample-app.zip'
-----
-
-
-
-[[cli.using-the-cli.embedded-shell]]
-=== Using the Embedded Shell
-Spring Boot includes command-line completion scripts for the BASH and zsh shells.
-If you do not use either of these shells (perhaps you are a Windows user), you can use the `shell` command to launch an integrated shell, as shown in the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ spring shell
- *Spring Boot* (v{spring-boot-version})
- Hit TAB to complete. Type \'help' and hit RETURN for help, and \'exit' to quit.
-----
-
-From inside the embedded shell, you can run other commands directly:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ version
- Spring CLI v{spring-boot-version}
-----
-
-The embedded shell supports ANSI color output as well as `tab` completion.
-If you need to run a native command, you can use the `!` prefix.
-To exit the embedded shell, press `ctrl-c`.
-
-
-
-[[cli.using-the-cli.extensions]]
-=== Adding Extensions to the CLI
-You can add extensions to the CLI by using the `install` command.
-The command takes one or more sets of artifact coordinates in the format `group:artifact:version`, as shown in the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ spring install com.example:spring-boot-cli-extension:1.0.0.RELEASE
-----
-
-In addition to installing the artifacts identified by the coordinates you supply, all of the artifacts' dependencies are also installed.
-
-To uninstall a dependency, use the `uninstall` command.
-As with the `install` command, it takes one or more sets of artifact coordinates in the format of `group:artifact:version`, as shown in the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ spring uninstall com.example:spring-boot-cli-extension:1.0.0.RELEASE
-----
-
-It uninstalls the artifacts identified by the coordinates you supply and their dependencies.
-
-To uninstall all additional dependencies, you can use the `--all` option, as shown in the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ spring uninstall --all
-----
-
-
-
-[[cli.groovy-beans-dsl]]
-== Developing Applications with the Groovy Beans DSL
-Spring Framework 4.0 has native support for a `beans{}` "`DSL`" (borrowed from https://grails.org/[Grails]), and you can embed bean definitions in your Groovy application scripts by using the same format.
-This is sometimes a good way to include external features like middleware declarations, as shown in the following example:
-
-[source,groovy,indent=0]
-----
- @Configuration(proxyBeanMethods = false)
- class Application implements CommandLineRunner {
-
- @Autowired
- SharedService service
-
- @Override
- void run(String... args) {
- println service.message
- }
-
- }
-
- import my.company.SharedService
-
- beans {
- service(SharedService) {
- message = "Hello World"
- }
- }
-----
-
-You can mix class declarations with `beans{}` in the same file as long as they stay at the top level, or, if you prefer, you can put the beans DSL in a separate file.
-
-
-
-[[cli.maven-setting]]
-== Configuring the CLI with settings.xml
-The Spring Boot CLI uses Aether, Maven's dependency resolution engine, to resolve dependencies.
-The CLI makes use of the Maven configuration found in `~/.m2/settings.xml` to configure Aether.
-The following configuration settings are honored by the CLI:
-
-* Offline
-* Mirrors
-* Servers
-* Proxies
-* Profiles
-** Activation
-** Repositories
-* Active profiles
-
-See https://maven.apache.org/settings.html[Maven's settings documentation] for further information.
-
-
-
-[[cli.whats-next]]
-== What to Read Next
-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 "<>", which you can use with Gradle or Maven.
+include::cli/whats-next.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/groovy-beans-dsl.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/groovy-beans-dsl.adoc
new file mode 100644
index 0000000000..336aa513b6
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/groovy-beans-dsl.adoc
@@ -0,0 +1,30 @@
+[[cli.groovy-beans-dsl]]
+== Developing Applications with the Groovy Beans DSL
+Spring Framework 4.0 has native support for a `beans{}` "`DSL`" (borrowed from https://grails.org/[Grails]), and you can embed bean definitions in your Groovy application scripts by using the same format.
+This is sometimes a good way to include external features like middleware declarations, as shown in the following example:
+
+[source,groovy,indent=0]
+----
+ @Configuration(proxyBeanMethods = false)
+ class Application implements CommandLineRunner {
+
+ @Autowired
+ SharedService service
+
+ @Override
+ void run(String... args) {
+ println service.message
+ }
+
+ }
+
+ import my.company.SharedService
+
+ beans {
+ service(SharedService) {
+ message = "Hello World"
+ }
+ }
+----
+
+You can mix class declarations with `beans{}` in the same file as long as they stay at the top level, or, if you prefer, you can put the beans DSL in a separate file.
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/installation.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/installation.adoc
new file mode 100644
index 0000000000..e4c1cdd9b1
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/installation.adoc
@@ -0,0 +1,4 @@
+[[cli.installation]]
+== Installing the CLI
+The Spring Boot CLI (Command-Line Interface) can be installed manually by using SDKMAN! (the SDK Manager) or by using Homebrew or MacPorts if you are an OSX user.
+See _<>_ in the "`Getting started`" section for comprehensive installation instructions.
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/maven-setting.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/maven-setting.adoc
new file mode 100644
index 0000000000..7ff6423802
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/maven-setting.adoc
@@ -0,0 +1,16 @@
+[[cli.maven-setting]]
+== Configuring the CLI with settings.xml
+The Spring Boot CLI uses Aether, Maven's dependency resolution engine, to resolve dependencies.
+The CLI makes use of the Maven configuration found in `~/.m2/settings.xml` to configure Aether.
+The following configuration settings are honored by the CLI:
+
+* Offline
+* Mirrors
+* Servers
+* Proxies
+* Profiles
+** Activation
+** Repositories
+* Active profiles
+
+See https://maven.apache.org/settings.html[Maven's settings documentation] for further information.
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/using-the-cli.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/using-the-cli.adoc
new file mode 100644
index 0000000000..ce26dd28e2
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/using-the-cli.adoc
@@ -0,0 +1,356 @@
+[[cli.using-the-cli]]
+== Using the CLI
+Once you have installed the CLI, you can run it by typing `spring` and pressing Enter at the command line.
+If you run `spring` without any arguments, a help screen is displayed, as follows:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ spring
+ usage: spring [--help] [--version]
+ []
+
+ Available commands are:
+
+ run [options] [--] [args]
+ Run a spring groovy script
+
+ _... more command help is shown here_
+----
+
+You can type `spring help` to get more details about any of the supported commands, as shown in the following example:
+
+[indent=0]
+----
+ $ spring help run
+ spring run - Run a spring groovy script
+
+ usage: spring run [options] [--] [args]
+
+ Option Description
+ ------ -----------
+ --autoconfigure [Boolean] Add autoconfigure compiler
+ transformations (default: true)
+ --classpath, -cp Additional classpath entries
+ --no-guess-dependencies Do not attempt to guess dependencies
+ --no-guess-imports Do not attempt to guess imports
+ -q, --quiet Quiet logging
+ -v, --verbose Verbose logging of dependency
+ resolution
+ --watch Watch the specified file for changes
+----
+
+The `version` command provides a quick way to check which version of Spring Boot you are using, as follows:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ spring version
+ Spring CLI v{spring-boot-version}
+----
+
+
+
+[[cli.using-the-cli.run]]
+=== Running Applications with the CLI
+You can compile and run Groovy source code by using the `run` command.
+The Spring Boot CLI is completely self-contained, so you do not need any external Groovy installation.
+
+The following example shows a "`hello world`" web application written in Groovy:
+
+.hello.groovy
+[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
+----
+ @RestController
+ class WebApplication {
+
+ @RequestMapping("/")
+ String home() {
+ "Hello World!"
+ }
+
+ }
+----
+
+To compile and run the application, type the following command:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ spring run hello.groovy
+----
+
+To pass command-line arguments to the application, use `--` to separate the commands from the "`spring`" command arguments, as shown in the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ spring run hello.groovy -- --server.port=9000
+----
+
+To set JVM command line arguments, you can use the `JAVA_OPTS` environment variable, as shown in the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ JAVA_OPTS=-Xmx1024m spring run hello.groovy
+----
+
+NOTE: When setting `JAVA_OPTS` on Microsoft Windows, make sure to quote the entire instruction, such as `set "JAVA_OPTS=-Xms256m -Xmx2048m"`.
+Doing so ensures the values are properly passed to the process.
+
+
+
+[[cli.using-the-cli.run.deduced-grab-annotations]]
+==== Deduced "`grab`" Dependencies
+Standard Groovy includes a `@Grab` annotation, which lets you declare dependencies on third-party libraries.
+This useful technique lets Groovy download jars in the same way as Maven or Gradle would but without requiring you to use a build tool.
+
+Spring Boot extends this technique further and tries to deduce which libraries to "`grab`" based on your code.
+For example, since the `WebApplication` code shown previously uses `@RestController` annotations, Spring Boot grabs "Tomcat" and "Spring MVC".
+
+The following items are used as "`grab hints`":
+
+|===
+| Items | Grabs
+
+| `JdbcTemplate`, `NamedParameterJdbcTemplate`, `DataSource`
+| JDBC Application.
+
+| `@EnableJms`
+| JMS Application.
+
+| `@EnableCaching`
+| Caching abstraction.
+
+| `@Test`
+| JUnit.
+
+| `@EnableRabbit`
+| RabbitMQ.
+
+| extends `Specification`
+| Spock test.
+
+| `@EnableBatchProcessing`
+| Spring Batch.
+
+| `@MessageEndpoint` `@EnableIntegration`
+| Spring Integration.
+
+| `@Controller` `@RestController` `@EnableWebMvc`
+| Spring MVC + Embedded Tomcat.
+
+| `@EnableWebSecurity`
+| Spring Security.
+
+| `@EnableTransactionManagement`
+| Spring Transaction Management.
+|===
+
+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.
+
+
+
+[[cli.using-the-cli.run.deduced-grab-coordinates]]
+==== Deduced "`grab`" Coordinates
+Spring Boot extends Groovy's standard `@Grab` support by letting you specify a dependency without a group or version (for example, `@Grab('freemarker')`).
+Doing so consults Spring Boot's default dependency metadata to deduce the artifact's group and version.
+
+NOTE: The default metadata is tied to the version of the CLI that you use.
+It changes only when you move to a new version of the CLI, putting you in control of when the versions of your dependencies may change.
+A table showing the dependencies and their versions that are included in the default metadata can be found in the <>.
+
+
+
+[[cli.using-the-cli.run.default-import-statements]]
+==== Default Import Statements
+To help reduce the size of your Groovy code, several `import` statements are automatically included.
+Notice how the preceding example refers to `@Component`, `@RestController`, and `@RequestMapping` without needing to use fully-qualified names or `import` statements.
+
+TIP: Many Spring annotations work without using `import` statements.
+Try running your application to see what fails before adding imports.
+
+
+
+[[cli.using-the-cli.run.automatic-main-method]]
+==== Automatic Main Method
+Unlike the equivalent Java application, you do not need to include a `public static void main(String[] args)` method with your `Groovy` scripts.
+A `SpringApplication` is automatically created, with your compiled code acting as the `source`.
+
+
+
+[[cli.using-the-cli.run.custom-dependency-management]]
+==== Custom Dependency Management
+By default, the CLI uses the dependency management declared in `spring-boot-dependencies` when resolving `@Grab` dependencies.
+Additional dependency management, which overrides the default dependency management, can be configured by using the `@DependencyManagementBom` annotation.
+The annotation's value should specify the coordinates (`groupId:artifactId:version`) of one or more Maven BOMs.
+
+For example, consider the following declaration:
+
+[source,groovy,indent=0]
+----
+ @DependencyManagementBom("com.example.custom-bom:1.0.0")
+----
+
+The preceding declaration picks up `custom-bom-1.0.0.pom` in a Maven repository under `com/example/custom-versions/1.0.0/`.
+
+When you specify multiple BOMs, they are applied in the order in which you declare them, as shown in the following example:
+
+[source,java,pending-extract=true,indent=0]
+----
+ @DependencyManagementBom(["com.example.custom-bom:1.0.0",
+ "com.example.another-bom:1.0.0"])
+----
+
+The preceding example indicates that the dependency management in `another-bom` overrides the dependency management in `custom-bom`.
+
+You can use `@DependencyManagementBom` anywhere that you can use `@Grab`.
+However, to ensure consistent ordering of the dependency management, you can use `@DependencyManagementBom` at most once in your application.
+
+
+
+[[cli.using-the-cli.multiple-source-files]]
+=== Applications with Multiple Source Files
+You can use "`shell globbing`" with all commands that accept file input.
+Doing so lets you use multiple files from a single directory, as shown in the following example:
+
+[indent=0]
+----
+ $ spring run *.groovy
+----
+
+
+
+[[cli.using-the-cli.packaging]]
+=== Packaging Your Application
+You can use the `jar` command to package your application into a self-contained executable jar file, as shown in the following example:
+
+[indent=0]
+----
+ $ spring jar my-app.jar *.groovy
+----
+
+The resulting jar contains the classes produced by compiling the application and all of the application's dependencies so that it can then be run by using `java -jar`.
+The jar file also contains entries from the application's classpath.
+You can add and remove explicit paths to the jar by using `--include` and `--exclude`.
+Both are comma-separated, and both accept prefixes, in the form of "`+`" and "`-`", to signify that they should be removed from the defaults.
+The default includes are as follows:
+
+[indent=0]
+----
+ public/**, resources/**, static/**, templates/**, META-INF/**, *
+----
+
+The default excludes are as follows:
+
+[indent=0]
+----
+ .*, repository/**, build/**, target/**, **/*.jar, **/*.groovy
+----
+
+Type `spring help jar` on the command line for more information.
+
+
+
+[[cli.using-the-cli.initialize-new-project]]
+=== Initialize a New Project
+The `init` command lets you create a new project by using https://start.spring.io without leaving the shell, as shown in the following example:
+
+[indent=0]
+----
+ $ spring init --dependencies=web,data-jpa my-project
+ Using service at https://start.spring.io
+ Project extracted to '/Users/developer/example/my-project'
+----
+
+The preceding example creates a `my-project` directory with a Maven-based project that uses `spring-boot-starter-web` and `spring-boot-starter-data-jpa`.
+You can list the capabilities of the service by using the `--list` flag, as shown in the following example:
+
+[indent=0]
+----
+ $ spring init --list
+ =======================================
+ Capabilities of https://start.spring.io
+ =======================================
+
+ Available dependencies:
+ -----------------------
+ actuator - Actuator: Production ready features to help you monitor and manage your application
+ ...
+ web - Web: Support for full-stack web development, including Tomcat and spring-webmvc
+ websocket - Websocket: Support for WebSocket development
+ ws - WS: Support for Spring Web Services
+
+ Available project types:
+ ------------------------
+ gradle-build - Gradle Config [format:build, build:gradle]
+ gradle-project - Gradle Project [format:project, build:gradle]
+ maven-build - Maven POM [format:build, build:maven]
+ maven-project - Maven Project [format:project, build:maven] (default)
+
+ ...
+----
+
+The `init` command supports many options.
+See the `help` output for more details.
+For instance, the following command creates a Gradle project that uses Java 8 and `war` packaging:
+
+[indent=0]
+----
+ $ spring init --build=gradle --java-version=1.8 --dependencies=websocket --packaging=war sample-app.zip
+ Using service at https://start.spring.io
+ Content saved to 'sample-app.zip'
+----
+
+
+
+[[cli.using-the-cli.embedded-shell]]
+=== Using the Embedded Shell
+Spring Boot includes command-line completion scripts for the BASH and zsh shells.
+If you do not use either of these shells (perhaps you are a Windows user), you can use the `shell` command to launch an integrated shell, as shown in the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ spring shell
+ *Spring Boot* (v{spring-boot-version})
+ Hit TAB to complete. Type \'help' and hit RETURN for help, and \'exit' to quit.
+----
+
+From inside the embedded shell, you can run other commands directly:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ version
+ Spring CLI v{spring-boot-version}
+----
+
+The embedded shell supports ANSI color output as well as `tab` completion.
+If you need to run a native command, you can use the `!` prefix.
+To exit the embedded shell, press `ctrl-c`.
+
+
+
+[[cli.using-the-cli.extensions]]
+=== Adding Extensions to the CLI
+You can add extensions to the CLI by using the `install` command.
+The command takes one or more sets of artifact coordinates in the format `group:artifact:version`, as shown in the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ spring install com.example:spring-boot-cli-extension:1.0.0.RELEASE
+----
+
+In addition to installing the artifacts identified by the coordinates you supply, all of the artifacts' dependencies are also installed.
+
+To uninstall a dependency, use the `uninstall` command.
+As with the `install` command, it takes one or more sets of artifact coordinates in the format of `group:artifact:version`, as shown in the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ spring uninstall com.example:spring-boot-cli-extension:1.0.0.RELEASE
+----
+
+It uninstalls the artifacts identified by the coordinates you supply and their dependencies.
+
+To uninstall all additional dependencies, you can use the `--all` option, as shown in the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ spring uninstall --all
+----
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/whats-next.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/whats-next.adoc
new file mode 100644
index 0000000000..f3d05acbfe
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/cli/whats-next.adoc
@@ -0,0 +1,7 @@
+[[cli.whats-next]]
+== What to Read Next
+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 "<>", which you can use with Gradle or Maven.
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/common-application-properties.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/common-application-properties.adoc
deleted file mode 100644
index ea6fa49ea3..0000000000
--- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/common-application-properties.adoc
+++ /dev/null
@@ -1,109 +0,0 @@
-:numbered!:
-[appendix]
-[[appendix.common-application-properties]]
-= Common Application properties
-include::attributes.adoc[]
-
-Various properties can be specified inside your `application.properties` file, inside your `application.yml` file, or as command line switches.
-This appendix provides a list of common Spring Boot properties and references to the underlying classes that consume them.
-
-TIP: Spring Boot provides various conversion mechanism with advanced value formatting, make sure to review <>.
-
-NOTE: Property contributions can come from additional jar files on your classpath, so you should not consider this an exhaustive list.
-Also, you can define your own properties.
-
-
-
-[[appendix.common-application-properties.core]]
-== Core Properties [[core-properties]]
-include::config-docs/core.adoc[]
-
-
-
-[[appendix.common-application-properties.cache]]
-== Cache Properties [[cache-properties]]
-include::config-docs/cache.adoc[]
-
-
-
-[[appendix.common-application-properties.mail]]
-== Mail Properties [[mail-properties]]
-include::config-docs/mail.adoc[]
-
-
-
-[[appendix.common-application-properties.json]]
-== JSON Properties [[json-properties]]
-include::config-docs/json.adoc[]
-
-
-
-[[appendix.common-application-properties.data]]
-== Data Properties [[data-properties]]
-include::config-docs/data.adoc[]
-
-
-
-[[appendix.common-application-properties.transaction]]
-== Transaction Properties [[transaction-properties]]
-include::config-docs/transaction.adoc[]
-
-
-
-[[appendix.common-application-properties.data-migration]]
-== Data Migration Properties [[data-migration-properties]]
-include::config-docs/data-migration.adoc[]
-
-
-
-[[appendix.common-application-properties.integration]]
-== Integration Properties [[integration-properties]]
-include::config-docs/integration.adoc[]
-
-
-
-[[appendix.common-application-properties.web]]
-== Web Properties [[web-properties]]
-include::config-docs/web.adoc[]
-
-
-
-[[appendix.common-application-properties.templating]]
-== Templating Properties [[templating-properties]]
-include::config-docs/templating.adoc[]
-
-
-
-[[appendix.common-application-properties.server]]
-== Server Properties [[server-properties]]
-include::config-docs/server.adoc[]
-
-
-
-[[appendix.common-application-properties.security]]
-== Security Properties [[security-properties]]
-include::config-docs/security.adoc[]
-
-
-
-[[appendix.common-application-properties.rsocket]]
-== RSocket Properties [[rsocket-properties]]
-include::config-docs/rsocket.adoc[]
-
-
-
-[[appendix.common-application-properties.actuator]]
-== Actuator Properties [[actuator-properties]]
-include::config-docs/actuator.adoc[]
-
-
-
-[[appendix.common-application-properties.devtools]]
-== Devtools Properties [[devtools-properties]]
-include::config-docs/devtools.adoc[]
-
-
-
-[[appendix.common-application-properties.testing]]
-== Testing Properties [[testing-properties]]
-include::config-docs/testing.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata.adoc
index e8587fb892..a2346feb67 100644
--- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata.adoc
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata.adoc
@@ -1,902 +1,20 @@
[appendix]
-[[appendix.configuration-metadata]]
+[[configuration-metadata]]
= Configuration Metadata
include::attributes.adoc[]
+
+
Spring Boot jars include metadata files that provide details of all supported configuration properties.
The files are designed to let IDE developers offer contextual help and "`code completion`" as users are working with `application.properties` or `application.yml` files.
The majority of the metadata file is generated automatically at compile time by processing all items annotated with `@ConfigurationProperties`.
-However, it is possible to <> for corner cases or more advanced use cases.
+However, it is possible to <> for corner cases or more advanced use cases.
-[[appendix.configuration-metadata.format]]
-== Metadata Format
-Configuration metadata files are located inside jars under `META-INF/spring-configuration-metadata.json`.
-They use a JSON format with items categorized under either "`groups`" or "`properties`" and additional values hints categorized under "hints", as shown in the following example:
+include::configuration-metadata/format.adoc[]
-[source,json,indent=0]
-----
- {"groups": [
- {
- "name": "server",
- "type": "org.springframework.boot.autoconfigure.web.ServerProperties",
- "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties"
- },
- {
- "name": "spring.jpa.hibernate",
- "type": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties$Hibernate",
- "sourceType": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties",
- "sourceMethod": "getHibernate()"
- }
- ...
- ],"properties": [
- {
- "name": "server.port",
- "type": "java.lang.Integer",
- "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties"
- },
- {
- "name": "server.address",
- "type": "java.net.InetAddress",
- "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties"
- },
- {
- "name": "spring.jpa.hibernate.ddl-auto",
- "type": "java.lang.String",
- "description": "DDL mode. This is actually a shortcut for the \"hibernate.hbm2ddl.auto\" property.",
- "sourceType": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties$Hibernate"
- }
- ...
- ],"hints": [
- {
- "name": "spring.jpa.hibernate.ddl-auto",
- "values": [
- {
- "value": "none",
- "description": "Disable DDL handling."
- },
- {
- "value": "validate",
- "description": "Validate the schema, make no changes to the database."
- },
- {
- "value": "update",
- "description": "Update the schema if necessary."
- },
- {
- "value": "create",
- "description": "Create the schema and destroy previous data."
- },
- {
- "value": "create-drop",
- "description": "Create and then destroy the schema at the end of the session."
- }
- ]
- }
- ]}
-----
+include::configuration-metadata/manual-hints.adoc[]
-Each "`property`" is a configuration item that the user specifies with a given value.
-For example, `server.port` and `server.address` might be specified in `application.properties`, as follows:
-
-[source,properties,indent=0,configprops]
-----
- server.port=9090
- server.address=127.0.0.1
-----
-
-The "`groups`" are higher level items that do not themselves specify a value but instead provide a contextual grouping for properties.
-For example, the `server.port` and `server.address` properties are part of the `server` group.
-
-NOTE: It is not required that every "`property`" has a "`group`".
-Some properties might exist in their own right.
-
-Finally, "`hints`" are additional information used to assist the user in configuring a given property.
-For example, when a developer is configuring the configprop:spring.jpa.hibernate.ddl-auto[] property, a tool can use the hints to offer some auto-completion help for the `none`, `validate`, `update`, `create`, and `create-drop` values.
-
-
-
-[[appendix.configuration-metadata.format.group]]
-=== Group Attributes
-The JSON object contained in the `groups` array can contain the attributes shown in the following table:
-
-[cols="1,1,4"]
-|===
-| Name | Type | Purpose
-
-| `name`
-| String
-| The full name of the group.
- This attribute is mandatory.
-
-| `type`
-| String
-| The class name of the data type of the group.
- For example, if the group were based on a class annotated with `@ConfigurationProperties`, the attribute would contain the fully qualified name of that class.
- If it were based on a `@Bean` method, it would be the return type of that method.
- If the type is not known, the attribute may be omitted.
-
-| `description`
-| String
-| A short description of the group that can be displayed to users.
- If no description is available, it may be omitted.
- It is recommended that descriptions be short paragraphs, with the first line providing a concise summary.
- The last line in the description should end with a period (`.`).
-
-| `sourceType`
-| String
-| The class name of the source that contributed this group.
- For example, if the group were based on a `@Bean` method annotated with `@ConfigurationProperties`, this attribute would contain the fully qualified name of the `@Configuration` class that contains the method.
- If the source type is not known, the attribute may be omitted.
-
-| `sourceMethod`
-| String
-| The full name of the method (include parenthesis and argument types) that contributed this group (for example, the name of a `@ConfigurationProperties` annotated `@Bean` method).
- If the source method is not known, it may be omitted.
-|===
-
-
-
-[[appendix.configuration-metadata.format.property]]
-=== Property Attributes
-The JSON object contained in the `properties` array can contain the attributes described in the following table:
-
-[cols="1,1,4"]
-|===
-| Name | Type | Purpose
-
-| `name`
-| String
-| The full name of the property.
- Names are in lower-case period-separated form (for example, `server.address`).
- This attribute is mandatory.
-
-| `type`
-| String
-| The full signature of the data type of the property (for example, `java.lang.String`) but also a full generic type (such as `java.util.Map`).
- You can use this attribute to guide the user as to the types of values that they can enter.
- For consistency, the type of a primitive is specified by using its wrapper counterpart (for example, `boolean` becomes `java.lang.Boolean`).
- Note that this class may be a complex type that gets converted from a `String` as values are bound.
- If the type is not known, it may be omitted.
-
-| `description`
-| String
-| A short description of the property that can be displayed to users.
- If no description is available, it may be omitted.
- It is recommended that descriptions be short paragraphs, with the first line providing a concise summary.
- The last line in the description should end with a period (`.`).
-
-| `sourceType`
-| String
-| The class name of the source that contributed this property.
- For example, if the property were from a class annotated with `@ConfigurationProperties`, this attribute would contain the fully qualified name of that class.
- If the source type is unknown, it may be omitted.
-
-| `defaultValue`
-| Object
-| The default value, which is used if the property is not specified.
- If the type of the property is an array, it can be an array of value(s).
- If the default value is unknown, it may be omitted.
-
-| `deprecation`
-| Deprecation
-| Specify whether the property is deprecated.
- If the field is not deprecated or if that information is not known, it may be omitted.
- The next table offers more detail about the `deprecation` attribute.
-|===
-
-The JSON object contained in the `deprecation` attribute of each `properties` element can contain the following attributes:
-
-[cols="1,1,4"]
-|===
-| Name | Type | Purpose
-
-| `level`
-| String
-| The level of deprecation, which can be either `warning` (the default) or `error`.
- When a property has a `warning` deprecation level, it should still be bound in the environment.
- However, when it has an `error` deprecation level, the property is no longer managed and is not bound.
-
-| `reason`
-| String
-| A short description of the reason why the property was deprecated.
- If no reason is available, it may be omitted.
- It is recommended that descriptions be short paragraphs, with the first line providing a concise summary.
- The last line in the description should end with a period (`.`).
-
-| `replacement`
-| String
-| The full name of the property that _replaces_ this deprecated property.
- If there is no replacement for this property, it may be omitted.
-|===
-
-NOTE: Prior to Spring Boot 1.3, a single `deprecated` boolean attribute can be used instead of the `deprecation` element.
-This is still supported in a deprecated fashion and should no longer be used.
-If no reason and replacement are available, an empty `deprecation` object should be set.
-
-Deprecation can also be specified declaratively in code by adding the `@DeprecatedConfigurationProperty` annotation to the getter exposing the deprecated property.
-For instance, assume that the `app.acme.target` property was confusing and was renamed to `app.acme.name`.
-The following example shows how to handle that situation:
-
-[source,java,pending-extract=true,indent=0]
-----
- @ConfigurationProperties("app.acme")
- public class AcmeProperties {
-
- private String name;
-
- public String getName() { ... }
-
- public void setName(String name) { ... }
-
- @DeprecatedConfigurationProperty(replacement = "app.acme.name")
- @Deprecated
- public String getTarget() {
- return getName();
- }
-
- @Deprecated
- public void setTarget(String target) {
- setName(target);
- }
- }
-----
-
-NOTE: There is no way to set a `level`.
-`warning` is always assumed, since code is still handling the property.
-
-The preceding code makes sure that the deprecated property still works (delegating to the `name` property behind the scenes).
-Once the `getTarget` and `setTarget` methods can be removed from your public API, the automatic deprecation hint in the metadata goes away as well.
-If you want to keep a hint, adding manual metadata with an `error` deprecation level ensures that users are still informed about that property.
-Doing so is particularly useful when a `replacement` is provided.
-
-
-
-[[appendix.configuration-metadata.format.hints]]
-=== Hint Attributes
-The JSON object contained in the `hints` array can contain the attributes shown in the following table:
-
-[cols="1,1,4"]
-|===
-| Name | Type | Purpose
-
-| `name`
-| String
-| The full name of the property to which this hint refers.
- Names are in lower-case period-separated form (such as `spring.mvc.servlet.path`).
- If the property refers to a map (such as `system.contexts`), the hint either applies to the _keys_ of the map (`system.contexts.keys`) or the _values_ (`system.contexts.values`) of the map.
- This attribute is mandatory.
-
-| `values`
-| ValueHint[]
-| A list of valid values as defined by the `ValueHint` object (described in the next table).
- Each entry defines the value and may have a description.
-
-| `providers`
-| ValueProvider[]
-| A list of providers as defined by the `ValueProvider` object (described later in this document).
- Each entry defines the name of the provider and its parameters, if any.
-|===
-
-The JSON object contained in the `values` attribute of each `hint` element can contain the attributes described in the following table:
-
-[cols="1,1,4"]
-|===
-| Name | Type | Purpose
-
-| `value`
-| Object
-| A valid value for the element to which the hint refers.
- If the type of the property is an array, it can also be an array of value(s).
- This attribute is mandatory.
-
-| `description`
-| String
-| A short description of the value that can be displayed to users.
- If no description is available, it may be omitted.
- It is recommended that descriptions be short paragraphs, with the first line providing a concise summary.
- The last line in the description should end with a period (`.`).
-|===
-
-The JSON object contained in the `providers` attribute of each `hint` element can contain the attributes described in the following table:
-
-[cols="1,1,4"]
-|===
-|Name | Type |Purpose
-
-| `name`
-| String
-| The name of the provider to use to offer additional content assistance for the element to which the hint refers.
-
-| `parameters`
-| JSON object
-| Any additional parameter that the provider supports (check the documentation of the provider for more details).
-|===
-
-
-
-[[appendix.configuration-metadata.format.repeated-items]]
-=== Repeated Metadata Items
-Objects with the same "`property`" and "`group`" name can appear multiple times within a metadata file.
-For example, you could bind two separate classes to the same prefix, with each having potentially overlapping property names.
-While the same names appearing in the metadata multiple times should not be common, consumers of metadata should take care to ensure that they support it.
-
-
-
-[[appendix.configuration-metadata.manual-hints]]
-== Providing Manual Hints
-To improve the user experience and further assist the user in configuring a given property, you can provide additional metadata that:
-
-* Describes the list of potential values for a property.
-* Associates a provider, to attach a well defined semantic to a property, so that a tool can discover the list of potential values based on the project's context.
-
-
-
-[[appendix.configuration-metadata.manual-hints.value-hint]]
-=== Value Hint
-The `name` attribute of each hint refers to the `name` of a property.
-In the <>, we provide five values for the `spring.jpa.hibernate.ddl-auto` property: `none`, `validate`, `update`, `create`, and `create-drop`.
-Each value may have a description as well.
-
-If your property is of type `Map`, you can provide hints for both the keys and the values (but not for the map itself).
-The special `.keys` and `.values` suffixes must refer to the keys and the values, respectively.
-
-Assume a `sample.contexts` maps magic `String` values to an integer, as shown in the following example:
-
-[source,java,pending-extract=true,indent=0]
-----
- @ConfigurationProperties("sample")
- public class SampleProperties {
-
- private Map contexts;
- // getters and setters
- }
-----
-
-The magic values are (in this example) are `sample1` and `sample2`.
-In order to offer additional content assistance for the keys, you could add the following JSON to <>:
-
-[source,json,indent=0]
-----
- {"hints": [
- {
- "name": "sample.contexts.keys",
- "values": [
- {
- "value": "sample1"
- },
- {
- "value": "sample2"
- }
- ]
- }
- ]}
-----
-
-TIP: We recommend that you use an `Enum` for those two values instead.
-If your IDE supports it, this is by far the most effective approach to auto-completion.
-
-
-
-[[appendix.configuration-metadata.manual-hints.value-providers]]
-=== Value Providers
-Providers are a powerful way to attach semantics to a property.
-In this section, we define the official providers that you can use for your own hints.
-However, your favorite IDE may implement some of these or none of them.
-Also, it could eventually provide its own.
-
-NOTE: As this is a new feature, IDE vendors must catch up with how it works.
-Adoption times naturally vary.
-
-The following table summarizes the list of supported providers:
-
-[cols="2,4"]
-|===
-| Name | Description
-
-| `any`
-| Permits any additional value to be provided.
-
-| `class-reference`
-| Auto-completes the classes available in the project.
- Usually constrained by a base class that is specified by the `target` parameter.
-
-| `handle-as`
-| Handles the property as if it were defined by the type defined by the mandatory `target` parameter.
-
-| `logger-name`
-| Auto-completes valid logger names and <>.
- Typically, package and class names available in the current project can be auto-completed as well as defined groups.
-
-| `spring-bean-reference`
-| Auto-completes the available bean names in the current project.
- Usually constrained by a base class that is specified by the `target` parameter.
-
-| `spring-profile-name`
-| Auto-completes the available Spring profile names in the project.
-|===
-
-TIP: Only one provider can be active for a given property, but you can specify several providers if they can all manage the property _in some way_.
-Make sure to place the most powerful provider first, as the IDE must use the first one in the JSON section that it can handle.
-If no provider for a given property is supported, no special content assistance is provided, either.
-
-
-
-[[appendix.configuration-metadata.manual-hints.value-providers.any]]
-==== Any
-The special **any** provider value permits any additional values to be provided.
-Regular value validation based on the property type should be applied if this is supported.
-
-This provider is typically used if you have a list of values and any extra values should still be considered as valid.
-
-The following example offers `on` and `off` as auto-completion values for `system.state`:
-
-[source,json,indent=0]
-----
- {"hints": [
- {
- "name": "system.state",
- "values": [
- {
- "value": "on"
- },
- {
- "value": "off"
- }
- ],
- "providers": [
- {
- "name": "any"
- }
- ]
- }
- ]}
-----
-
-Note that, in the preceding example, any other value is also allowed.
-
-
-
-[[appendix.configuration-metadata.manual-hints.value-providers.class-reference]]
-==== Class Reference
-The **class-reference** provider auto-completes classes available in the project.
-This provider supports the following parameters:
-
-[cols="1,1,2,4"]
-|===
-| Parameter | Type | Default value | Description
-
-| `target`
-| `String` (`Class`)
-| _none_
-| The fully qualified name of the class that should be assignable to the chosen value.
- Typically used to filter out-non candidate classes.
- Note that this information can be provided by the type itself by exposing a class with the appropriate upper bound.
-
-| `concrete`
-| `boolean`
-| true
-| Specify whether only concrete classes are to be considered as valid candidates.
-|===
-
-
-The following metadata snippet corresponds to the standard `server.servlet.jsp.class-name` property that defines the `JspServlet` class name to use:
-
-[source,json,indent=0]
-----
- {"hints": [
- {
- "name": "server.servlet.jsp.class-name",
- "providers": [
- {
- "name": "class-reference",
- "parameters": {
- "target": "javax.servlet.http.HttpServlet"
- }
- }
- ]
- }
- ]}
-----
-
-
-
-[[appendix.configuration-metadata.manual-hints.value-providers.handle-as]]
-==== Handle As
-The **handle-as** provider lets you substitute the type of the property to a more high-level type.
-This typically happens when the property has a `java.lang.String` type, because you do not want your configuration classes to rely on classes that may not be on the classpath.
-This provider supports the following parameters:
-
-[cols="1,1,2,4"]
-|===
-| Parameter | Type | Default value | Description
-
-| **`target`**
-| `String` (`Class`)
-| _none_
-| The fully qualified name of the type to consider for the property.
- This parameter is mandatory.
-|===
-
-The following types can be used:
-
-* Any `java.lang.Enum`: Lists the possible values for the property.
- (We recommend defining the property with the `Enum` type, as no further hint should be required for the IDE to auto-complete the values)
-* `java.nio.charset.Charset`: Supports auto-completion of charset/encoding values (such as `UTF-8`)
-* `java.util.Locale`: auto-completion of locales (such as `en_US`)
-* `org.springframework.util.MimeType`: Supports auto-completion of content type values (such as `text/plain`)
-* `org.springframework.core.io.Resource`: Supports auto-completion of Spring’s Resource abstraction to refer to a file on the filesystem or on the classpath (such as `classpath:/sample.properties`)
-
-TIP: If multiple values can be provided, use a `Collection` or _Array_ type to teach the IDE about it.
-
-The following metadata snippet corresponds to the standard `spring.liquibase.change-log` property that defines the path to the changelog to use.
-It is actually used internally as a `org.springframework.core.io.Resource` but cannot be exposed as such, because we need to keep the original String value to pass it to the Liquibase API.
-
-[source,json,indent=0]
-----
- {"hints": [
- {
- "name": "spring.liquibase.change-log",
- "providers": [
- {
- "name": "handle-as",
- "parameters": {
- "target": "org.springframework.core.io.Resource"
- }
- }
- ]
- }
- ]}
-----
-
-
-
-[[appendix.configuration-metadata.manual-hints.value-providers.logger-name]]
-==== Logger Name
-The **logger-name** provider auto-completes valid logger names and <>.
-Typically, package and class names available in the current project can be auto-completed.
-If groups are enabled (default) and if a custom logger group is identified in the configuration, auto-completion for it should be provided.
-Specific frameworks may have extra magic logger names that can be supported as well.
-
-This provider supports the following parameters:
-
-[cols="1,1,2,4"]
-|===
-| Parameter | Type | Default value | Description
-
-| `group`
-| `boolean`
-| `true`
-| Specify whether known groups should be considered.
-|===
-
-Since a logger name can be any arbitrary name, this provider should allow any value but could highlight valid package and class names that are not available in the project's classpath.
-
-The following metadata snippet corresponds to the standard `logging.level` property.
-Keys are _logger names_, and values correspond to the standard log levels or any custom level.
-As Spring Boot defines a few logger groups out-of-the-box, dedicated value hints have been added for those.
-
-[source,json,indent=0]
-----
- {"hints": [
- {
- "name": "logging.level.keys",
- "values": [
- {
- "value": "root",
- "description": "Root logger used to assign the default logging level."
- },
- {
- "value": "sql",
- "description": "SQL logging group including Hibernate SQL logger."
- },
- {
- "value": "web",
- "description": "Web logging group including codecs."
- }
- ],
- "providers": [
- {
- "name": "logger-name"
- }
- ]
- },
- {
- "name": "logging.level.values",
- "values": [
- {
- "value": "trace"
- },
- {
- "value": "debug"
- },
- {
- "value": "info"
- },
- {
- "value": "warn"
- },
- {
- "value": "error"
- },
- {
- "value": "fatal"
- },
- {
- "value": "off"
- }
-
- ],
- "providers": [
- {
- "name": "any"
- }
- ]
- }
- ]}
-----
-
-
-
-[[appendix.configuration-metadata.manual-hints.value-providers.spring-bean-reference]]
-==== Spring Bean Reference
-The **spring-bean-reference** provider auto-completes the beans that are defined in the configuration of the current project.
-This provider supports the following parameters:
-
-[cols="1,1,2,4"]
-|===
-| Parameter | Type | Default value | Description
-
-| `target`
-| `String` (`Class`)
-| _none_
-| The fully qualified name of the bean class that should be assignable to the candidate.
- Typically used to filter out non-candidate beans.
-|===
-
-The following metadata snippet corresponds to the standard `spring.jmx.server` property that defines the name of the `MBeanServer` bean to use:
-
-[source,json,indent=0]
-----
- {"hints": [
- {
- "name": "spring.jmx.server",
- "providers": [
- {
- "name": "spring-bean-reference",
- "parameters": {
- "target": "javax.management.MBeanServer"
- }
- }
- ]
- }
- ]}
-----
-
-NOTE: The binder is not aware of the metadata.
-If you provide that hint, you still need to transform the bean name into an actual Bean reference using by the `ApplicationContext`.
-
-
-
-[[appendix.configuration-metadata.manual-hints.value-providers.spring-profile-name]]
-==== Spring Profile Name
-The **spring-profile-name** provider auto-completes the Spring profiles that are defined in the configuration of the current project.
-
-The following metadata snippet corresponds to the standard `spring.profiles.active` property that defines the name of the Spring profile(s) to enable:
-
-[source,json,indent=0]
-----
- {"hints": [
- {
- "name": "spring.profiles.active",
- "providers": [
- {
- "name": "spring-profile-name"
- }
- ]
- }
- ]}
-----
-
-
-
-[[appendix.configuration-metadata.annotation-processor]]
-== Generating Your Own Metadata by Using the Annotation Processor
-You can easily generate your own configuration metadata file from items annotated with `@ConfigurationProperties` by using the `spring-boot-configuration-processor` jar.
-The jar includes a Java annotation processor which is invoked as your project is compiled.
-
-
-
-[[appendix.configuration-metadata.annotation-processor.configuring]]
-=== Configuring the Annotation Processor
-To use the processor, include a dependency on `spring-boot-configuration-processor`.
-
-With Maven the dependency should be declared as optional, as shown in the following example:
-
-[source,xml,indent=0,subs="verbatim,quotes,attributes"]
-----
-
- org.springframework.boot
- spring-boot-configuration-processor
- true
-
-----
-
-With Gradle, the dependency should be declared in the `annotationProcessor` configuration, as shown in the following example:
-
-[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
-----
- dependencies {
- annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
- }
-----
-
-If you are using an `additional-spring-configuration-metadata.json` file, the `compileJava` task should be configured to depend on the `processResources` task, as shown in the following example:
-
-[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
-----
- compileJava.inputs.files(processResources)
-----
-
-This dependency ensures that the additional metadata is available when the annotation processor runs during compilation.
-
-[NOTE]
-====
-If you are using AspectJ in your project, you need to make sure that the annotation processor runs only once.
-There are several ways to do this.
-With Maven, you can configure the `maven-apt-plugin` explicitly and add the dependency to the annotation processor only there.
-You could also let the AspectJ plugin run all the processing and disable annotation processing in the `maven-compiler-plugin` configuration, as follows:
-
-[source,xml,indent=0,subs="verbatim,quotes,attributes"]
-----
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
- none
-
-
-----
-====
-
-
-
-[[appendix.configuration-metadata.annotation-processor.automatic-metadata-generation]]
-=== Automatic Metadata Generation
-The processor picks up both classes and methods that are annotated with `@ConfigurationProperties`.
-
-If the class is also annotated with `@ConstructorBinding`, a single constructor is expected and one property is created per constructor parameter.
-Otherwise, properties are discovered through the presence of standard getters and setters with special handling for collection and map types (that is detected even if only a getter is present).
-The annotation processor also supports the use of the `@Data`, `@Getter`, and `@Setter` lombok annotations.
-
-Consider the following example:
-
-[source,java,pending-extract=true,indent=0,subs="verbatim,attributes"]
-----
- @ConfigurationProperties(prefix="server")
- public class ServerProperties {
-
- /**
- * Name of the server.
- */
- private String name;
-
- /**
- * IP address to listen to.
- */
- private String ip = "127.0.0.1";
-
- /**
- * Port to listener to.
- */
- private int port = 9797;
-
- // ... getter and setters
-
- }
-----
-
-This exposes three properties where `server.name` has no default and `server.ip` and `server.port` defaults to `"127.0.0.1"` and `9797` respectively.
-The Javadoc on fields is used to populate the `description` attribute. For instance, the description of `server.ip` is "IP address to listen to.".
-
-NOTE: You should only use plain text with `@ConfigurationProperties` field Javadoc, since they are not processed before being added to the JSON.
-
-The annotation processor applies a number of heuristics to extract the default value from the source model.
-Default values have to be provided statically. In particular, do not refer to a constant defined in another class.
-Also, the annotation processor cannot auto-detect default values for ``Enum``s and ``Collections``s.
-
-For cases where the default value could not be detected, <> should be provided.
-Consider the following example:
-
-[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
-----
- @ConfigurationProperties(prefix = "acme.messaging")
- public class MessagingProperties {
-
- private List addresses = new ArrayList<>(Arrays.asList("a", "b"));
-
- private ContainerType containerType = ContainerType.SIMPLE;
-
- // ... getter and setters
-
- public enum ContainerType {
-
- SIMPLE,
- DIRECT
-
- }
-
- }
-----
-
-In order to document default values for properties in the class above, you could add the following content to <>:
-
-[source,json,indent=0]
-----
- {"properties": [
- {
- "name": "acme.messaging.addresses",
- "defaultValue": ["a", "b"]
- },
- {
- "name": "acme.messaging.container-type",
- "defaultValue": "simple"
- }
- ]}
-----
-
-NOTE: Only the `name` of the property is required to document additional metadata for existing properties.
-
-
-
-[[appendix.configuration-metadata.annotation-processor.automatic-metadata-generation.nested-properties]]
-==== Nested Properties
-The annotation processor automatically considers inner classes as nested properties.
-Rather than documenting the `ip` and `port` at the root of the namespace, we could create a sub-namespace for it.
-Consider the updated example:
-
-[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
-----
- @ConfigurationProperties(prefix="server")
- public class ServerProperties {
-
- private String name;
-
- private Host host;
-
- // ... getter and setters
-
- public static class Host {
-
- private String ip;
-
- private int port;
-
- // ... getter and setters
-
- }
-
- }
-----
-
-The preceding example produces metadata information for `server.name`, `server.host.ip`, and `server.host.port` properties.
-You can use the `@NestedConfigurationProperty` annotation on a field to indicate that a regular (non-inner) class should be treated as if it were nested.
-
-TIP: This has no effect on collections and maps, as those types are automatically identified, and a single metadata property is generated for each of them.
-
-
-
-[[appendix.configuration-metadata.annotation-processor.adding-additional-metadata]]
-=== Adding Additional Metadata
-Spring Boot's configuration file handling is quite flexible, and it is often the case that properties may exist that are not bound to a `@ConfigurationProperties` bean.
-You may also need to tune some attributes of an existing key.
-To support such cases and let you provide custom "hints", the annotation processor automatically merges items from `META-INF/additional-spring-configuration-metadata.json` into the main metadata file.
-
-If you refer to a property that has been detected automatically, the description, default value, and deprecation information are overridden, if specified.
-If the manual property declaration is not identified in the current module, it is added as a new property.
-
-The format of the `additional-spring-configuration-metadata.json` file is exactly the same as the regular `spring-configuration-metadata.json`.
-The additional properties file is optional.
-If you do not have any additional properties, do not add the file.
+include::configuration-metadata/annotation-processor.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc
new file mode 100644
index 0000000000..993275a71f
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc
@@ -0,0 +1,198 @@
+[[configuration-metadata.annotation-processor]]
+== Generating Your Own Metadata by Using the Annotation Processor
+You can easily generate your own configuration metadata file from items annotated with `@ConfigurationProperties` by using the `spring-boot-configuration-processor` jar.
+The jar includes a Java annotation processor which is invoked as your project is compiled.
+
+
+
+[[configuration-metadata.annotation-processor.configuring]]
+=== Configuring the Annotation Processor
+To use the processor, include a dependency on `spring-boot-configuration-processor`.
+
+With Maven the dependency should be declared as optional, as shown in the following example:
+
+[source,xml,indent=0,subs="verbatim,quotes,attributes"]
+----
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+ true
+
+----
+
+With Gradle, the dependency should be declared in the `annotationProcessor` configuration, as shown in the following example:
+
+[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
+----
+ dependencies {
+ annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
+ }
+----
+
+If you are using an `additional-spring-configuration-metadata.json` file, the `compileJava` task should be configured to depend on the `processResources` task, as shown in the following example:
+
+[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
+----
+ compileJava.inputs.files(processResources)
+----
+
+This dependency ensures that the additional metadata is available when the annotation processor runs during compilation.
+
+[NOTE]
+====
+If you are using AspectJ in your project, you need to make sure that the annotation processor runs only once.
+There are several ways to do this.
+With Maven, you can configure the `maven-apt-plugin` explicitly and add the dependency to the annotation processor only there.
+You could also let the AspectJ plugin run all the processing and disable annotation processing in the `maven-compiler-plugin` configuration, as follows:
+
+[source,xml,indent=0,subs="verbatim,quotes,attributes"]
+----
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ none
+
+
+----
+====
+
+
+
+[[configuration-metadata.annotation-processor.automatic-metadata-generation]]
+=== Automatic Metadata Generation
+The processor picks up both classes and methods that are annotated with `@ConfigurationProperties`.
+
+If the class is also annotated with `@ConstructorBinding`, a single constructor is expected and one property is created per constructor parameter.
+Otherwise, properties are discovered through the presence of standard getters and setters with special handling for collection and map types (that is detected even if only a getter is present).
+The annotation processor also supports the use of the `@Data`, `@Getter`, and `@Setter` lombok annotations.
+
+Consider the following example:
+
+[source,java,pending-extract=true,indent=0,subs="verbatim,attributes"]
+----
+ @ConfigurationProperties(prefix="server")
+ public class ServerProperties {
+
+ /**
+ * Name of the server.
+ */
+ private String name;
+
+ /**
+ * IP address to listen to.
+ */
+ private String ip = "127.0.0.1";
+
+ /**
+ * Port to listener to.
+ */
+ private int port = 9797;
+
+ // ... getter and setters
+
+ }
+----
+
+This exposes three properties where `server.name` has no default and `server.ip` and `server.port` defaults to `"127.0.0.1"` and `9797` respectively.
+The Javadoc on fields is used to populate the `description` attribute. For instance, the description of `server.ip` is "IP address to listen to.".
+
+NOTE: You should only use plain text with `@ConfigurationProperties` field Javadoc, since they are not processed before being added to the JSON.
+
+The annotation processor applies a number of heuristics to extract the default value from the source model.
+Default values have to be provided statically. In particular, do not refer to a constant defined in another class.
+Also, the annotation processor cannot auto-detect default values for ``Enum``s and ``Collections``s.
+
+For cases where the default value could not be detected, <> should be provided.
+Consider the following example:
+
+[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
+----
+ @ConfigurationProperties(prefix = "acme.messaging")
+ public class MessagingProperties {
+
+ private List addresses = new ArrayList<>(Arrays.asList("a", "b"));
+
+ private ContainerType containerType = ContainerType.SIMPLE;
+
+ // ... getter and setters
+
+ public enum ContainerType {
+
+ SIMPLE,
+ DIRECT
+
+ }
+
+ }
+----
+
+In order to document default values for properties in the class above, you could add the following content to <>:
+
+[source,json,indent=0]
+----
+ {"properties": [
+ {
+ "name": "acme.messaging.addresses",
+ "defaultValue": ["a", "b"]
+ },
+ {
+ "name": "acme.messaging.container-type",
+ "defaultValue": "simple"
+ }
+ ]}
+----
+
+NOTE: Only the `name` of the property is required to document additional metadata for existing properties.
+
+
+
+[[configuration-metadata.annotation-processor.automatic-metadata-generation.nested-properties]]
+==== Nested Properties
+The annotation processor automatically considers inner classes as nested properties.
+Rather than documenting the `ip` and `port` at the root of the namespace, we could create a sub-namespace for it.
+Consider the updated example:
+
+[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
+----
+ @ConfigurationProperties(prefix="server")
+ public class ServerProperties {
+
+ private String name;
+
+ private Host host;
+
+ // ... getter and setters
+
+ public static class Host {
+
+ private String ip;
+
+ private int port;
+
+ // ... getter and setters
+
+ }
+
+ }
+----
+
+The preceding example produces metadata information for `server.name`, `server.host.ip`, and `server.host.port` properties.
+You can use the `@NestedConfigurationProperty` annotation on a field to indicate that a regular (non-inner) class should be treated as if it were nested.
+
+TIP: This has no effect on collections and maps, as those types are automatically identified, and a single metadata property is generated for each of them.
+
+
+
+[[configuration-metadata.annotation-processor.adding-additional-metadata]]
+=== Adding Additional Metadata
+Spring Boot's configuration file handling is quite flexible, and it is often the case that properties may exist that are not bound to a `@ConfigurationProperties` bean.
+You may also need to tune some attributes of an existing key.
+To support such cases and let you provide custom "hints", the annotation processor automatically merges items from `META-INF/additional-spring-configuration-metadata.json` into the main metadata file.
+
+If you refer to a property that has been detected automatically, the description, default value, and deprecation information are overridden, if specified.
+If the manual property declaration is not identified in the current module, it is added as a new property.
+
+The format of the `additional-spring-configuration-metadata.json` file is exactly the same as the regular `spring-configuration-metadata.json`.
+The additional properties file is optional.
+If you do not have any additional properties, do not add the file.
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/format.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/format.adoc
new file mode 100644
index 0000000000..84f5c3efc7
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/format.adoc
@@ -0,0 +1,311 @@
+[[configuration-metadata.format]]
+== Metadata Format
+Configuration metadata files are located inside jars under `META-INF/spring-configuration-metadata.json`.
+They use a JSON format with items categorized under either "`groups`" or "`properties`" and additional values hints categorized under "hints", as shown in the following example:
+
+[source,json,indent=0]
+----
+ {"groups": [
+ {
+ "name": "server",
+ "type": "org.springframework.boot.autoconfigure.web.ServerProperties",
+ "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties"
+ },
+ {
+ "name": "spring.jpa.hibernate",
+ "type": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties$Hibernate",
+ "sourceType": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties",
+ "sourceMethod": "getHibernate()"
+ }
+ ...
+ ],"properties": [
+ {
+ "name": "server.port",
+ "type": "java.lang.Integer",
+ "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties"
+ },
+ {
+ "name": "server.address",
+ "type": "java.net.InetAddress",
+ "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties"
+ },
+ {
+ "name": "spring.jpa.hibernate.ddl-auto",
+ "type": "java.lang.String",
+ "description": "DDL mode. This is actually a shortcut for the \"hibernate.hbm2ddl.auto\" property.",
+ "sourceType": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties$Hibernate"
+ }
+ ...
+ ],"hints": [
+ {
+ "name": "spring.jpa.hibernate.ddl-auto",
+ "values": [
+ {
+ "value": "none",
+ "description": "Disable DDL handling."
+ },
+ {
+ "value": "validate",
+ "description": "Validate the schema, make no changes to the database."
+ },
+ {
+ "value": "update",
+ "description": "Update the schema if necessary."
+ },
+ {
+ "value": "create",
+ "description": "Create the schema and destroy previous data."
+ },
+ {
+ "value": "create-drop",
+ "description": "Create and then destroy the schema at the end of the session."
+ }
+ ]
+ }
+ ]}
+----
+
+Each "`property`" is a configuration item that the user specifies with a given value.
+For example, `server.port` and `server.address` might be specified in `application.properties`, as follows:
+
+[source,properties,indent=0,configprops]
+----
+ server.port=9090
+ server.address=127.0.0.1
+----
+
+The "`groups`" are higher level items that do not themselves specify a value but instead provide a contextual grouping for properties.
+For example, the `server.port` and `server.address` properties are part of the `server` group.
+
+NOTE: It is not required that every "`property`" has a "`group`".
+Some properties might exist in their own right.
+
+Finally, "`hints`" are additional information used to assist the user in configuring a given property.
+For example, when a developer is configuring the configprop:spring.jpa.hibernate.ddl-auto[] property, a tool can use the hints to offer some auto-completion help for the `none`, `validate`, `update`, `create`, and `create-drop` values.
+
+
+
+[[configuration-metadata.format.group]]
+=== Group Attributes
+The JSON object contained in the `groups` array can contain the attributes shown in the following table:
+
+[cols="1,1,4"]
+|===
+| Name | Type | Purpose
+
+| `name`
+| String
+| The full name of the group.
+ This attribute is mandatory.
+
+| `type`
+| String
+| The class name of the data type of the group.
+ For example, if the group were based on a class annotated with `@ConfigurationProperties`, the attribute would contain the fully qualified name of that class.
+ If it were based on a `@Bean` method, it would be the return type of that method.
+ If the type is not known, the attribute may be omitted.
+
+| `description`
+| String
+| A short description of the group that can be displayed to users.
+ If no description is available, it may be omitted.
+ It is recommended that descriptions be short paragraphs, with the first line providing a concise summary.
+ The last line in the description should end with a period (`.`).
+
+| `sourceType`
+| String
+| The class name of the source that contributed this group.
+ For example, if the group were based on a `@Bean` method annotated with `@ConfigurationProperties`, this attribute would contain the fully qualified name of the `@Configuration` class that contains the method.
+ If the source type is not known, the attribute may be omitted.
+
+| `sourceMethod`
+| String
+| The full name of the method (include parenthesis and argument types) that contributed this group (for example, the name of a `@ConfigurationProperties` annotated `@Bean` method).
+ If the source method is not known, it may be omitted.
+|===
+
+
+
+[[configuration-metadata.format.property]]
+=== Property Attributes
+The JSON object contained in the `properties` array can contain the attributes described in the following table:
+
+[cols="1,1,4"]
+|===
+| Name | Type | Purpose
+
+| `name`
+| String
+| The full name of the property.
+ Names are in lower-case period-separated form (for example, `server.address`).
+ This attribute is mandatory.
+
+| `type`
+| String
+| The full signature of the data type of the property (for example, `java.lang.String`) but also a full generic type (such as `java.util.Map`).
+ You can use this attribute to guide the user as to the types of values that they can enter.
+ For consistency, the type of a primitive is specified by using its wrapper counterpart (for example, `boolean` becomes `java.lang.Boolean`).
+ Note that this class may be a complex type that gets converted from a `String` as values are bound.
+ If the type is not known, it may be omitted.
+
+| `description`
+| String
+| A short description of the property that can be displayed to users.
+ If no description is available, it may be omitted.
+ It is recommended that descriptions be short paragraphs, with the first line providing a concise summary.
+ The last line in the description should end with a period (`.`).
+
+| `sourceType`
+| String
+| The class name of the source that contributed this property.
+ For example, if the property were from a class annotated with `@ConfigurationProperties`, this attribute would contain the fully qualified name of that class.
+ If the source type is unknown, it may be omitted.
+
+| `defaultValue`
+| Object
+| The default value, which is used if the property is not specified.
+ If the type of the property is an array, it can be an array of value(s).
+ If the default value is unknown, it may be omitted.
+
+| `deprecation`
+| Deprecation
+| Specify whether the property is deprecated.
+ If the field is not deprecated or if that information is not known, it may be omitted.
+ The next table offers more detail about the `deprecation` attribute.
+|===
+
+The JSON object contained in the `deprecation` attribute of each `properties` element can contain the following attributes:
+
+[cols="1,1,4"]
+|===
+| Name | Type | Purpose
+
+| `level`
+| String
+| The level of deprecation, which can be either `warning` (the default) or `error`.
+ When a property has a `warning` deprecation level, it should still be bound in the environment.
+ However, when it has an `error` deprecation level, the property is no longer managed and is not bound.
+
+| `reason`
+| String
+| A short description of the reason why the property was deprecated.
+ If no reason is available, it may be omitted.
+ It is recommended that descriptions be short paragraphs, with the first line providing a concise summary.
+ The last line in the description should end with a period (`.`).
+
+| `replacement`
+| String
+| The full name of the property that _replaces_ this deprecated property.
+ If there is no replacement for this property, it may be omitted.
+|===
+
+NOTE: Prior to Spring Boot 1.3, a single `deprecated` boolean attribute can be used instead of the `deprecation` element.
+This is still supported in a deprecated fashion and should no longer be used.
+If no reason and replacement are available, an empty `deprecation` object should be set.
+
+Deprecation can also be specified declaratively in code by adding the `@DeprecatedConfigurationProperty` annotation to the getter exposing the deprecated property.
+For instance, assume that the `app.acme.target` property was confusing and was renamed to `app.acme.name`.
+The following example shows how to handle that situation:
+
+[source,java,pending-extract=true,indent=0]
+----
+ @ConfigurationProperties("app.acme")
+ public class AcmeProperties {
+
+ private String name;
+
+ public String getName() { ... }
+
+ public void setName(String name) { ... }
+
+ @DeprecatedConfigurationProperty(replacement = "app.acme.name")
+ @Deprecated
+ public String getTarget() {
+ return getName();
+ }
+
+ @Deprecated
+ public void setTarget(String target) {
+ setName(target);
+ }
+ }
+----
+
+NOTE: There is no way to set a `level`.
+`warning` is always assumed, since code is still handling the property.
+
+The preceding code makes sure that the deprecated property still works (delegating to the `name` property behind the scenes).
+Once the `getTarget` and `setTarget` methods can be removed from your public API, the automatic deprecation hint in the metadata goes away as well.
+If you want to keep a hint, adding manual metadata with an `error` deprecation level ensures that users are still informed about that property.
+Doing so is particularly useful when a `replacement` is provided.
+
+
+
+[[configuration-metadata.format.hints]]
+=== Hint Attributes
+The JSON object contained in the `hints` array can contain the attributes shown in the following table:
+
+[cols="1,1,4"]
+|===
+| Name | Type | Purpose
+
+| `name`
+| String
+| The full name of the property to which this hint refers.
+ Names are in lower-case period-separated form (such as `spring.mvc.servlet.path`).
+ If the property refers to a map (such as `system.contexts`), the hint either applies to the _keys_ of the map (`system.contexts.keys`) or the _values_ (`system.contexts.values`) of the map.
+ This attribute is mandatory.
+
+| `values`
+| ValueHint[]
+| A list of valid values as defined by the `ValueHint` object (described in the next table).
+ Each entry defines the value and may have a description.
+
+| `providers`
+| ValueProvider[]
+| A list of providers as defined by the `ValueProvider` object (described later in this document).
+ Each entry defines the name of the provider and its parameters, if any.
+|===
+
+The JSON object contained in the `values` attribute of each `hint` element can contain the attributes described in the following table:
+
+[cols="1,1,4"]
+|===
+| Name | Type | Purpose
+
+| `value`
+| Object
+| A valid value for the element to which the hint refers.
+ If the type of the property is an array, it can also be an array of value(s).
+ This attribute is mandatory.
+
+| `description`
+| String
+| A short description of the value that can be displayed to users.
+ If no description is available, it may be omitted.
+ It is recommended that descriptions be short paragraphs, with the first line providing a concise summary.
+ The last line in the description should end with a period (`.`).
+|===
+
+The JSON object contained in the `providers` attribute of each `hint` element can contain the attributes described in the following table:
+
+[cols="1,1,4"]
+|===
+|Name | Type |Purpose
+
+| `name`
+| String
+| The name of the provider to use to offer additional content assistance for the element to which the hint refers.
+
+| `parameters`
+| JSON object
+| Any additional parameter that the provider supports (check the documentation of the provider for more details).
+|===
+
+
+
+[[configuration-metadata.format.repeated-items]]
+=== Repeated Metadata Items
+Objects with the same "`property`" and "`group`" name can appear multiple times within a metadata file.
+For example, you could bind two separate classes to the same prefix, with each having potentially overlapping property names.
+While the same names appearing in the metadata multiple times should not be common, consumers of metadata should take care to ensure that they support it.
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/manual-hints.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/manual-hints.adoc
new file mode 100644
index 0000000000..7ad151578a
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/manual-hints.adoc
@@ -0,0 +1,374 @@
+[[configuration-metadata.manual-hints]]
+== Providing Manual Hints
+To improve the user experience and further assist the user in configuring a given property, you can provide additional metadata that:
+
+* Describes the list of potential values for a property.
+* Associates a provider, to attach a well defined semantic to a property, so that a tool can discover the list of potential values based on the project's context.
+
+
+
+[[configuration-metadata.manual-hints.value-hint]]
+=== Value Hint
+The `name` attribute of each hint refers to the `name` of a property.
+In the <>, we provide five values for the `spring.jpa.hibernate.ddl-auto` property: `none`, `validate`, `update`, `create`, and `create-drop`.
+Each value may have a description as well.
+
+If your property is of type `Map`, you can provide hints for both the keys and the values (but not for the map itself).
+The special `.keys` and `.values` suffixes must refer to the keys and the values, respectively.
+
+Assume a `sample.contexts` maps magic `String` values to an integer, as shown in the following example:
+
+[source,java,pending-extract=true,indent=0]
+----
+ @ConfigurationProperties("sample")
+ public class SampleProperties {
+
+ private Map contexts;
+ // getters and setters
+ }
+----
+
+The magic values are (in this example) are `sample1` and `sample2`.
+In order to offer additional content assistance for the keys, you could add the following JSON to <>:
+
+[source,json,indent=0]
+----
+ {"hints": [
+ {
+ "name": "sample.contexts.keys",
+ "values": [
+ {
+ "value": "sample1"
+ },
+ {
+ "value": "sample2"
+ }
+ ]
+ }
+ ]}
+----
+
+TIP: We recommend that you use an `Enum` for those two values instead.
+If your IDE supports it, this is by far the most effective approach to auto-completion.
+
+
+
+[[configuration-metadata.manual-hints.value-providers]]
+=== Value Providers
+Providers are a powerful way to attach semantics to a property.
+In this section, we define the official providers that you can use for your own hints.
+However, your favorite IDE may implement some of these or none of them.
+Also, it could eventually provide its own.
+
+NOTE: As this is a new feature, IDE vendors must catch up with how it works.
+Adoption times naturally vary.
+
+The following table summarizes the list of supported providers:
+
+[cols="2,4"]
+|===
+| Name | Description
+
+| `any`
+| Permits any additional value to be provided.
+
+| `class-reference`
+| Auto-completes the classes available in the project.
+ Usually constrained by a base class that is specified by the `target` parameter.
+
+| `handle-as`
+| Handles the property as if it were defined by the type defined by the mandatory `target` parameter.
+
+| `logger-name`
+| Auto-completes valid logger names and <>.
+ Typically, package and class names available in the current project can be auto-completed as well as defined groups.
+
+| `spring-bean-reference`
+| Auto-completes the available bean names in the current project.
+ Usually constrained by a base class that is specified by the `target` parameter.
+
+| `spring-profile-name`
+| Auto-completes the available Spring profile names in the project.
+|===
+
+TIP: Only one provider can be active for a given property, but you can specify several providers if they can all manage the property _in some way_.
+Make sure to place the most powerful provider first, as the IDE must use the first one in the JSON section that it can handle.
+If no provider for a given property is supported, no special content assistance is provided, either.
+
+
+
+[[configuration-metadata.manual-hints.value-providers.any]]
+==== Any
+The special **any** provider value permits any additional values to be provided.
+Regular value validation based on the property type should be applied if this is supported.
+
+This provider is typically used if you have a list of values and any extra values should still be considered as valid.
+
+The following example offers `on` and `off` as auto-completion values for `system.state`:
+
+[source,json,indent=0]
+----
+ {"hints": [
+ {
+ "name": "system.state",
+ "values": [
+ {
+ "value": "on"
+ },
+ {
+ "value": "off"
+ }
+ ],
+ "providers": [
+ {
+ "name": "any"
+ }
+ ]
+ }
+ ]}
+----
+
+Note that, in the preceding example, any other value is also allowed.
+
+
+
+[[configuration-metadata.manual-hints.value-providers.class-reference]]
+==== Class Reference
+The **class-reference** provider auto-completes classes available in the project.
+This provider supports the following parameters:
+
+[cols="1,1,2,4"]
+|===
+| Parameter | Type | Default value | Description
+
+| `target`
+| `String` (`Class`)
+| _none_
+| The fully qualified name of the class that should be assignable to the chosen value.
+ Typically used to filter out-non candidate classes.
+ Note that this information can be provided by the type itself by exposing a class with the appropriate upper bound.
+
+| `concrete`
+| `boolean`
+| true
+| Specify whether only concrete classes are to be considered as valid candidates.
+|===
+
+
+The following metadata snippet corresponds to the standard `server.servlet.jsp.class-name` property that defines the `JspServlet` class name to use:
+
+[source,json,indent=0]
+----
+ {"hints": [
+ {
+ "name": "server.servlet.jsp.class-name",
+ "providers": [
+ {
+ "name": "class-reference",
+ "parameters": {
+ "target": "javax.servlet.http.HttpServlet"
+ }
+ }
+ ]
+ }
+ ]}
+----
+
+
+
+[[configuration-metadata.manual-hints.value-providers.handle-as]]
+==== Handle As
+The **handle-as** provider lets you substitute the type of the property to a more high-level type.
+This typically happens when the property has a `java.lang.String` type, because you do not want your configuration classes to rely on classes that may not be on the classpath.
+This provider supports the following parameters:
+
+[cols="1,1,2,4"]
+|===
+| Parameter | Type | Default value | Description
+
+| **`target`**
+| `String` (`Class`)
+| _none_
+| The fully qualified name of the type to consider for the property.
+ This parameter is mandatory.
+|===
+
+The following types can be used:
+
+* Any `java.lang.Enum`: Lists the possible values for the property.
+ (We recommend defining the property with the `Enum` type, as no further hint should be required for the IDE to auto-complete the values)
+* `java.nio.charset.Charset`: Supports auto-completion of charset/encoding values (such as `UTF-8`)
+* `java.util.Locale`: auto-completion of locales (such as `en_US`)
+* `org.springframework.util.MimeType`: Supports auto-completion of content type values (such as `text/plain`)
+* `org.springframework.core.io.Resource`: Supports auto-completion of Spring’s Resource abstraction to refer to a file on the filesystem or on the classpath (such as `classpath:/sample.properties`)
+
+TIP: If multiple values can be provided, use a `Collection` or _Array_ type to teach the IDE about it.
+
+The following metadata snippet corresponds to the standard `spring.liquibase.change-log` property that defines the path to the changelog to use.
+It is actually used internally as a `org.springframework.core.io.Resource` but cannot be exposed as such, because we need to keep the original String value to pass it to the Liquibase API.
+
+[source,json,indent=0]
+----
+ {"hints": [
+ {
+ "name": "spring.liquibase.change-log",
+ "providers": [
+ {
+ "name": "handle-as",
+ "parameters": {
+ "target": "org.springframework.core.io.Resource"
+ }
+ }
+ ]
+ }
+ ]}
+----
+
+
+
+[[configuration-metadata.manual-hints.value-providers.logger-name]]
+==== Logger Name
+The **logger-name** provider auto-completes valid logger names and <>.
+Typically, package and class names available in the current project can be auto-completed.
+If groups are enabled (default) and if a custom logger group is identified in the configuration, auto-completion for it should be provided.
+Specific frameworks may have extra magic logger names that can be supported as well.
+
+This provider supports the following parameters:
+
+[cols="1,1,2,4"]
+|===
+| Parameter | Type | Default value | Description
+
+| `group`
+| `boolean`
+| `true`
+| Specify whether known groups should be considered.
+|===
+
+Since a logger name can be any arbitrary name, this provider should allow any value but could highlight valid package and class names that are not available in the project's classpath.
+
+The following metadata snippet corresponds to the standard `logging.level` property.
+Keys are _logger names_, and values correspond to the standard log levels or any custom level.
+As Spring Boot defines a few logger groups out-of-the-box, dedicated value hints have been added for those.
+
+[source,json,indent=0]
+----
+ {"hints": [
+ {
+ "name": "logging.level.keys",
+ "values": [
+ {
+ "value": "root",
+ "description": "Root logger used to assign the default logging level."
+ },
+ {
+ "value": "sql",
+ "description": "SQL logging group including Hibernate SQL logger."
+ },
+ {
+ "value": "web",
+ "description": "Web logging group including codecs."
+ }
+ ],
+ "providers": [
+ {
+ "name": "logger-name"
+ }
+ ]
+ },
+ {
+ "name": "logging.level.values",
+ "values": [
+ {
+ "value": "trace"
+ },
+ {
+ "value": "debug"
+ },
+ {
+ "value": "info"
+ },
+ {
+ "value": "warn"
+ },
+ {
+ "value": "error"
+ },
+ {
+ "value": "fatal"
+ },
+ {
+ "value": "off"
+ }
+
+ ],
+ "providers": [
+ {
+ "name": "any"
+ }
+ ]
+ }
+ ]}
+----
+
+
+
+[[configuration-metadata.manual-hints.value-providers.spring-bean-reference]]
+==== Spring Bean Reference
+The **spring-bean-reference** provider auto-completes the beans that are defined in the configuration of the current project.
+This provider supports the following parameters:
+
+[cols="1,1,2,4"]
+|===
+| Parameter | Type | Default value | Description
+
+| `target`
+| `String` (`Class`)
+| _none_
+| The fully qualified name of the bean class that should be assignable to the candidate.
+ Typically used to filter out non-candidate beans.
+|===
+
+The following metadata snippet corresponds to the standard `spring.jmx.server` property that defines the name of the `MBeanServer` bean to use:
+
+[source,json,indent=0]
+----
+ {"hints": [
+ {
+ "name": "spring.jmx.server",
+ "providers": [
+ {
+ "name": "spring-bean-reference",
+ "parameters": {
+ "target": "javax.management.MBeanServer"
+ }
+ }
+ ]
+ }
+ ]}
+----
+
+NOTE: The binder is not aware of the metadata.
+If you provide that hint, you still need to transform the bean name into an actual Bean reference using by the `ApplicationContext`.
+
+
+
+[[configuration-metadata.manual-hints.value-providers.spring-profile-name]]
+==== Spring Profile Name
+The **spring-profile-name** provider auto-completes the Spring profiles that are defined in the configuration of the current project.
+
+The following metadata snippet corresponds to the standard `spring.profiles.active` property that defines the name of the Spring profile(s) to enable:
+
+[source,json,indent=0]
+----
+ {"hints": [
+ {
+ "name": "spring.profiles.active",
+ "providers": [
+ {
+ "name": "spring-profile-name"
+ }
+ ]
+ }
+ ]}
+----
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/dependency-versions.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/dependency-versions.adoc
index 05f5a20bf4..8e33b0b0e7 100644
--- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/dependency-versions.adoc
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/dependency-versions.adoc
@@ -1,27 +1,14 @@
[appendix]
-[[appendix.dependency-versions]]
-= Dependency versions
+[[dependency-versions]]
+= Dependency Versions
include::attributes.adoc[]
+
+
This appendix provides details of the dependencies that are managed by Spring Boot.
-[[appendix.dependency-versions.coordinates]]
-== Managed Dependency Coordinates
+include::dependency-versions/coordinates.adoc[]
-The following table provides details of all of the dependency versions that are provided by Spring Boot in its CLI (Command Line Interface), Maven dependency management, and Gradle plugin.
-When you declare a dependency on one of these artifacts without declaring a version, the version listed in the table is used.
-
-include::generated-dependency-versions.adoc[]
-
-
-
-[[appendix.dependency-versions.properties]]
-== Version Properties
-
-The following table provides all properties that can be used to override the versions managed by Spring Boot.
-Browse the {spring-boot-code}/spring-boot-project/spring-boot-dependencies/build.gradle[`spring-boot-dependencies` build.gradle] for a complete list of dependencies.
-You can learn how to customize these versions in your application in the <>.
-
-include::generated-version-properties.adoc[]
+include::dependency-versions/properties.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/dependency-versions/coordinates.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/dependency-versions/coordinates.adoc
new file mode 100644
index 0000000000..981831b262
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/dependency-versions/coordinates.adoc
@@ -0,0 +1,7 @@
+[[dependency-versions.coordinates]]
+== Managed Dependency Coordinates
+
+The following table provides details of all of the dependency versions that are provided by Spring Boot in its CLI (Command Line Interface), Maven dependency management, and Gradle plugin.
+When you declare a dependency on one of these artifacts without declaring a version, the version listed in the table is used.
+
+include::documented-coordinates.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/dependency-versions/properties.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/dependency-versions/properties.adoc
new file mode 100644
index 0000000000..a2bdfa141d
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/dependency-versions/properties.adoc
@@ -0,0 +1,8 @@
+[[dependency-versions.properties]]
+== Version Properties
+
+The following table provides all properties that can be used to override the versions managed by Spring Boot.
+Browse the {spring-boot-code}/spring-boot-project/spring-boot-dependencies/build.gradle[`spring-boot-dependencies` build.gradle] for a complete list of dependencies.
+You can learn how to customize these versions in your application in the <>.
+
+include::documented-properties.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment.adoc
index eef88b99cb..c390eb5846 100644
--- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment.adoc
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment.adoc
@@ -2,6 +2,8 @@
= Deploying Spring Boot Applications
include::attributes.adoc[]
+
+
Spring Boot's flexible packaging options provide a great deal of choice when it comes to deploying your application.
You can deploy Spring Boot applications to a variety of cloud platforms, to container images (such as Docker), or to virtual/real machines.
@@ -9,851 +11,10 @@ This section covers some of the more common deployment scenarios.
-[[deployment.containers]]
-== Deploying to Containers
-If you are running your application from a container, you can use an executable jar, but it is also often an advantage to explode it and run it in a different way.
-Certain PaaS implementations may also choose to unpack archives before they run.
-For example, Cloud Foundry operates this way.
-One way to run an unpacked archive is by starting the appropriate launcher, as follows:
+include::deployment/containers.adoc[]
-[indent=0]
-----
- $ jar -xf myapp.jar
- $ java org.springframework.boot.loader.JarLauncher
-----
+include::deployment/cloud.adoc[]
-This is actually slightly faster on startup (depending on the size of the jar) than running from an unexploded archive.
-At runtime you shouldn't expect any differences.
+include::deployment/installing.adoc[]
-Once you have unpacked the jar file, you can also get an extra boost to startup time by running the app with its "natural" main method instead of the `JarLauncher`. For example:
-
-[indent=0]
-----
- $ jar -xf myapp.jar
- $ java -cp BOOT-INF/classes:BOOT-INF/lib/* com.example.MyApplication
-----
-
-NOTE: Using the `JarLauncher` over the application's main method has the added benefit of a predictable classpath order.
-The jar contains a `classpath.idx` file which is used by the `JarLauncher` when constructing the classpath.
-
-More efficient container images can also be created by <> for your dependencies and application classes and resources (which normally change more frequently).
-
-
-
-[[deployment.cloud]]
-== Deploying to the Cloud
-Spring Boot's executable jars are ready-made for most popular cloud PaaS (Platform-as-a-Service) providers.
-These providers tend to require that you "`bring your own container`".
-They manage application processes (not Java applications specifically), so they need an intermediary layer that adapts _your_ application to the _cloud's_ notion of a running process.
-
-Two popular cloud providers, Heroku and Cloud Foundry, employ a "`buildpack`" approach.
-The buildpack wraps your deployed code in whatever is needed to _start_ your application.
-It might be a JDK and a call to `java`, an embedded web server, or a full-fledged application server.
-A buildpack is pluggable, but ideally you should be able to get by with as few customizations to it as possible.
-This reduces the footprint of functionality that is not under your control.
-It minimizes divergence between development and production environments.
-
-Ideally, your application, like a Spring Boot executable jar, has everything that it needs to run packaged within it.
-
-In this section, we look at what it takes to get the <> in the "`Getting Started`" section up and running in the Cloud.
-
-
-
-[[deployment.cloud.cloud-foundry]]
-=== Cloud Foundry
-Cloud Foundry provides default buildpacks that come into play if no other buildpack is specified.
-The Cloud Foundry https://github.com/cloudfoundry/java-buildpack[Java buildpack] has excellent support for Spring applications, including Spring Boot.
-You can deploy stand-alone executable jar applications as well as traditional `.war` packaged applications.
-
-Once you have built your application (by using, for example, `mvn clean package`) and have https://docs.cloudfoundry.org/cf-cli/install-go-cli.html[installed the `cf` command line tool], deploy your application by using the `cf push` command, substituting the path to your compiled `.jar`.
-Be sure to have https://docs.cloudfoundry.org/cf-cli/getting-started.html#login[logged in with your `cf` command line client] before pushing an application.
-The following line shows using the `cf push` command to deploy an application:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ cf push acloudyspringtime -p target/demo-0.0.1-SNAPSHOT.jar
-----
-
-NOTE: In the preceding example, we substitute `acloudyspringtime` for whatever value you give `cf` as the name of your application.
-
-See the https://docs.cloudfoundry.org/cf-cli/getting-started.html#push[`cf push` documentation] for more options.
-If there is a Cloud Foundry https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html[`manifest.yml`] file present in the same directory, it is considered.
-
-At this point, `cf` starts uploading your application, producing output similar to the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- Uploading acloudyspringtime... *OK*
- Preparing to start acloudyspringtime... *OK*
- -----> Downloaded app package (*8.9M*)
- -----> Java Buildpack Version: v3.12 (offline) | https://github.com/cloudfoundry/java-buildpack.git#6f25b7e
- -----> Downloading Open Jdk JRE 1.8.0_121 from https://java-buildpack.cloudfoundry.org/openjdk/trusty/x86_64/openjdk-1.8.0_121.tar.gz (found in cache)
- Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.6s)
- -----> Downloading Open JDK Like Memory Calculator 2.0.2_RELEASE from https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/memory-calculator-2.0.2_RELEASE.tar.gz (found in cache)
- Memory Settings: -Xss349K -Xmx681574K -XX:MaxMetaspaceSize=104857K -Xms681574K -XX:MetaspaceSize=104857K
- -----> Downloading Container Certificate Trust Store 1.0.0_RELEASE from https://java-buildpack.cloudfoundry.org/container-certificate-trust-store/container-certificate-trust-store-1.0.0_RELEASE.jar (found in cache)
- Adding certificates to .java-buildpack/container_certificate_trust_store/truststore.jks (0.6s)
- -----> Downloading Spring Auto Reconfiguration 1.10.0_RELEASE from https://java-buildpack.cloudfoundry.org/auto-reconfiguration/auto-reconfiguration-1.10.0_RELEASE.jar (found in cache)
- Checking status of app 'acloudyspringtime'...
- 0 of 1 instances running (1 starting)
- ...
- 0 of 1 instances running (1 starting)
- ...
- 0 of 1 instances running (1 starting)
- ...
- 1 of 1 instances running (1 running)
-
- App started
-----
-
-Congratulations! The application is now live!
-
-Once your application is live, you can verify the status of the deployed application by using the `cf apps` command, as shown in the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ cf apps
- Getting applications in ...
- OK
-
- name requested state instances memory disk urls
- ...
- acloudyspringtime started 1/1 512M 1G acloudyspringtime.cfapps.io
- ...
-----
-
-Once Cloud Foundry acknowledges that your application has been deployed, you should be able to find the application at the URI given.
-In the preceding example, you could find it at `\https://acloudyspringtime.cfapps.io/`.
-
-
-
-[[deployment.cloud.cloud-foundry.binding-to-services]]
-==== Binding to Services
-By default, metadata about the running application as well as service connection information is exposed to the application as environment variables (for example: `$VCAP_SERVICES`).
-This architecture decision is due to Cloud Foundry's polyglot (any language and platform can be supported as a buildpack) nature.
-Process-scoped environment variables are language agnostic.
-
-Environment variables do not always make for the easiest API, so Spring Boot automatically extracts them and flattens the data into properties that can be accessed through Spring's `Environment` abstraction, as shown in the following example:
-
-[source,java,pending-extract=true,indent=0]
-----
- @Component
- class MyBean implements EnvironmentAware {
-
- private String instanceId;
-
- @Override
- public void setEnvironment(Environment environment) {
- this.instanceId = environment.getProperty("vcap.application.instance_id");
- }
-
- // ...
-
- }
-----
-
-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 {spring-boot-module-api}/cloud/CloudFoundryVcapEnvironmentPostProcessor.html['`CloudFoundryVcapEnvironmentPostProcessor`'] Javadoc for complete details.
-
-TIP: The https://github.com/pivotal-cf/java-cfenv/[Java CFEnv] project is a better fit for tasks such as configuring a DataSource.
-
-
-
-[[deployment.cloud.kubernetes]]
-=== Kubernetes
-Spring Boot auto-detects Kubernetes deployment environments by checking the environment for `"*_SERVICE_HOST"` and `"*_SERVICE_PORT"` variables.
-You can override this detection with the configprop:spring.main.cloud-platform[] configuration property.
-
-Spring Boot helps you to <> and export it with <>.
-
-
-
-[[deployment.cloud.kubernetes.container-lifecycle]]
-==== Kubernetes Container Lifecycle
-When Kubernetes deletes an application instance, the shutdown process involves several subsystems concurrently: shutdown hooks, unregistering the service, removing the instance from the load-balancer...
-Because this shutdown processing happens in parallel (and due to the nature of distributed systems), there is a window during which traffic can be routed to a pod that has also begun its shutdown processing.
-
-You can configure a sleep execution in a preStop handler to avoid requests being routed to a pod that has already begun shutting down.
-This sleep should be long enough for new requests to stop being routed to the pod and its duration will vary from deployment to deployment.
-The preStop handler can be configured via the PodSpec in the pod's configuration file as follows:
-
-[source,yml,indent=0]
-----
-spec:
- containers:
- - name: example-container
- image: example-image
- lifecycle:
- preStop:
- exec:
- command: ["sh", "-c", "sleep 10"]
-----
-
-Once the pre-stop hook has completed, SIGTERM will be sent to the container and <> will begin, allowing any remaining in-flight requests to complete.
-
-
-
-[[deployment.cloud.heroku]]
-=== Heroku
-Heroku is another popular PaaS platform.
-To customize Heroku builds, you provide a `Procfile`, which provides the incantation required to deploy an application.
-Heroku assigns a `port` for the Java application to use and then ensures that routing to the external URI works.
-
-You must configure your application to listen on the correct port.
-The following example shows the `Procfile` for our starter REST application:
-
-[indent=0]
-----
- web: java -Dserver.port=$PORT -jar target/demo-0.0.1-SNAPSHOT.jar
-----
-
-Spring Boot makes `-D` arguments available as properties accessible from a Spring `Environment` instance.
-The `server.port` configuration property is fed to the embedded Tomcat, Jetty, or Undertow instance, which then uses the port when it starts up.
-The `$PORT` environment variable is assigned to us by the Heroku PaaS.
-
-This should be everything you need.
-The most common deployment workflow for Heroku deployments is to `git push` the code to production, as shown in the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ git push heroku main
-
- Initializing repository, *done*.
- Counting objects: 95, *done*.
- Delta compression using up to 8 threads.
- Compressing objects: 100% (78/78), *done*.
- Writing objects: 100% (95/95), 8.66 MiB | 606.00 KiB/s, *done*.
- Total 95 (delta 31), reused 0 (delta 0)
-
- -----> Java app detected
- -----> Installing OpenJDK 1.8... *done*
- -----> Installing Maven 3.3.1... *done*
- -----> Installing settings.xml... *done*
- -----> Executing: mvn -B -DskipTests=true clean install
-
- [INFO] Scanning for projects...
- Downloading: https://repo.spring.io/...
- Downloaded: https://repo.spring.io/... (818 B at 1.8 KB/sec)
- ....
- Downloaded: https://s3pository.heroku.com/jvm/... (152 KB at 595.3 KB/sec)
- [INFO] Installing /tmp/build_0c35a5d2-a067-4abc-a232-14b1fb7a8229/target/...
- [INFO] Installing /tmp/build_0c35a5d2-a067-4abc-a232-14b1fb7a8229/pom.xml ...
- [INFO] ------------------------------------------------------------------------
- [INFO] *BUILD SUCCESS*
- [INFO] ------------------------------------------------------------------------
- [INFO] Total time: 59.358s
- [INFO] Finished at: Fri Mar 07 07:28:25 UTC 2014
- [INFO] Final Memory: 20M/493M
- [INFO] ------------------------------------------------------------------------
-
- -----> Discovering process types
- Procfile declares types -> *web*
-
- -----> Compressing... *done*, 70.4MB
- -----> Launching... *done*, v6
- https://agile-sierra-1405.herokuapp.com/ *deployed to Heroku*
-
- To git@heroku.com:agile-sierra-1405.git
- * [new branch] main -> main
-----
-
-Your application should now be up and running on Heroku.
-For more details, refer to https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku[Deploying Spring Boot Applications to Heroku].
-
-
-
-[[deployment.cloud.openshift]]
-=== OpenShift
-https://www.openshift.com/[OpenShift] has many resources describing how to deploy Spring Boot applications, including:
-
-* https://blog.openshift.com/using-openshift-enterprise-grade-spring-boot-deployments/[Using the S2I builder]
-* https://access.redhat.com/documentation/en-us/reference_architectures/2017/html-single/spring_boot_microservices_on_red_hat_openshift_container_platform_3/[Architecture guide]
-* https://blog.openshift.com/using-spring-boot-on-openshift/[Running as a traditional web application on Wildfly]
-* https://blog.openshift.com/openshift-commons-briefing-96-cloud-native-applications-spring-rhoar/[OpenShift Commons Briefing]
-
-
-
-[[deployment.cloud.aws]]
-=== Amazon Web Services (AWS)
-Amazon Web Services offers multiple ways to install Spring Boot-based applications, either as traditional web applications (war) or as executable jar files with an embedded web server.
-The options include:
-
-* AWS Elastic Beanstalk
-* AWS Code Deploy
-* AWS OPS Works
-* AWS Cloud Formation
-* AWS Container Registry
-
-Each has different features and pricing models.
-In this document, we describe to approach using AWS Elastic Beanstalk.
-
-
-
-[[deployment.cloud.aws.beanstalk]]
-==== AWS Elastic Beanstalk
-As described in the official https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Java.html[Elastic Beanstalk Java guide], there are two main options to deploy a Java application.
-You can either use the "`Tomcat Platform`" or the "`Java SE platform`".
-
-
-
-[[deployment.cloud.aws.beanstalk.tomcat-platform]]
-===== Using the Tomcat Platform
-This option applies to Spring Boot projects that produce a war file.
-No special configuration is required.
-You need only follow the official guide.
-
-
-
-[[deployment.cloud.aws.beanstalk.java-se-platform]]
-===== Using the Java SE Platform
-This option applies to Spring Boot projects that produce a jar file and run an embedded web container.
-Elastic Beanstalk environments run an nginx instance on port 80 to proxy the actual application, running on port 5000.
-To configure it, add the following line to your `application.properties` file:
-
-[indent=0]
-----
- server.port=5000
-----
-
-
-[TIP]
-.Upload binaries instead of sources
-====
-By default, Elastic Beanstalk uploads sources and compiles them in AWS.
-However, it is best to upload the binaries instead.
-To do so, add lines similar to the following to your `.elasticbeanstalk/config.yml` file:
-
-[source,xml,indent=0,subs="verbatim,quotes,attributes"]
-----
- deploy:
- artifact: target/demo-0.0.1-SNAPSHOT.jar
-----
-====
-
-[TIP]
-.Reduce costs by setting the environment type
-====
-By default an Elastic Beanstalk environment is load balanced.
-The load balancer has a significant cost.
-To avoid that cost, set the environment type to "`Single instance`", as described in https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-create-wizard.html#environments-create-wizard-capacity[the Amazon documentation].
-You can also create single instance environments by using the CLI and the following command:
-
-[indent=0]
-----
- eb create -s
-----
-====
-
-
-
-[[deployment.cloud.aws.summary]]
-==== Summary
-This is one of the easiest ways to get to AWS, but there are more things to cover, such as how to integrate Elastic Beanstalk into any CI / CD tool, use the Elastic Beanstalk Maven plugin instead of the CLI, and others.
-There is a https://exampledriven.wordpress.com/2017/01/09/spring-boot-aws-elastic-beanstalk-example/[blog post] covering these topics more in detail.
-
-
-
-[[deployment.cloud.boxfuse]]
-=== Boxfuse and Amazon Web Services
-https://boxfuse.com/[Boxfuse] works by turning your Spring Boot executable jar or war into a minimal VM image that can be deployed unchanged either on VirtualBox or on AWS.
-Boxfuse comes with deep integration for Spring Boot and uses the information from your Spring Boot configuration file to automatically configure ports and health check URLs.
-Boxfuse leverages this information both for the images it produces as well as for all the resources it provisions (instances, security groups, elastic load balancers, and so on).
-
-Once you have created a https://console.boxfuse.com[Boxfuse account], connected it to your AWS account, installed the latest version of the Boxfuse Client, and ensured that the application has been built by Maven or Gradle (by using, for example, `mvn clean package`), you can deploy your Spring Boot application to AWS with a command similar to the following:
-
-[indent=0]
-----
- $ boxfuse run myapp-1.0.jar -env=prod
-----
-
-See the https://boxfuse.com/docs/commandline/run.html[`boxfuse run` documentation] for more options.
-If there is a https://boxfuse.com/docs/commandline/#configuration[`boxfuse.conf`] file present in the current directory, it is considered.
-
-TIP: By default, Boxfuse activates a Spring profile named `boxfuse` on startup.
-If your executable jar or war contains an https://boxfuse.com/docs/payloads/springboot.html#configuration[`application-boxfuse.properties`] file, Boxfuse bases its configuration on the properties it contains.
-
-At this point, `boxfuse` creates an image for your application, uploads it, and configures and starts the necessary resources on AWS, resulting in output similar to the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- Fusing Image for myapp-1.0.jar ...
- Image fused in 00:06.838s (53937 K) -> axelfontaine/myapp:1.0
- Creating axelfontaine/myapp ...
- Pushing axelfontaine/myapp:1.0 ...
- Verifying axelfontaine/myapp:1.0 ...
- Creating Elastic IP ...
- Mapping myapp-axelfontaine.boxfuse.io to 52.28.233.167 ...
- Waiting for AWS to create an AMI for axelfontaine/myapp:1.0 in eu-central-1 (this may take up to 50 seconds) ...
- AMI created in 00:23.557s -> ami-d23f38cf
- Creating security group boxfuse-sg_axelfontaine/myapp:1.0 ...
- Launching t2.micro instance of axelfontaine/myapp:1.0 (ami-d23f38cf) in eu-central-1 ...
- Instance launched in 00:30.306s -> i-92ef9f53
- Waiting for AWS to boot Instance i-92ef9f53 and Payload to start at https://52.28.235.61/ ...
- Payload started in 00:29.266s -> https://52.28.235.61/
- Remapping Elastic IP 52.28.233.167 to i-92ef9f53 ...
- Waiting 15s for AWS to complete Elastic IP Zero Downtime transition ...
- Deployment completed successfully. axelfontaine/myapp:1.0 is up and running at https://myapp-axelfontaine.boxfuse.io/
-----
-
-Your application should now be up and running on AWS.
-
-See the blog post on https://boxfuse.com/blog/spring-boot-ec2.html[deploying Spring Boot apps on EC2] as well as the https://boxfuse.com/docs/payloads/springboot.html[documentation for the Boxfuse Spring Boot integration] to get started with a Maven build to run the app.
-
-
-
-[[deployment.cloud.google]]
-=== Google Cloud
-Google Cloud has several options that can be used to launch Spring Boot applications.
-The easiest to get started with is probably App Engine, but you could also find ways to run Spring Boot in a container with Container Engine or on a virtual machine with Compute Engine.
-
-To run in App Engine, you can create a project in the UI first, which sets up a unique identifier for you and also sets up HTTP routes.
-Add a Java app to the project and leave it empty and then use the https://cloud.google.com/sdk/install[Google Cloud SDK] to push your Spring Boot app into that slot from the command line or CI build.
-
-App Engine Standard requires you to use WAR packaging.
-Follow https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/appengine-java8/springboot-helloworld/README.md[these steps] to deploy App Engine Standard application to Google Cloud.
-
-Alternatively, App Engine Flex requires you to create an `app.yaml` file to describe the resources your app requires.
-Normally, you put this file in `src/main/appengine`, and it should resemble the following file:
-
-[source,yaml,indent=0]
-----
- service: default
-
- runtime: java
- env: flex
-
- runtime_config:
- jdk: openjdk8
-
- handlers:
- - url: /.*
- script: this field is required, but ignored
-
- manual_scaling:
- instances: 1
-
- health_check:
- enable_health_check: False
-
- env_variables:
- ENCRYPT_KEY: your_encryption_key_here
-----
-
-You can deploy the app (for example, with a Maven plugin) by adding the project ID to the build configuration, as shown in the following example:
-
-[source,xml,indent=0,subs="verbatim,quotes,attributes"]
-----
-
- com.google.cloud.tools
- appengine-maven-plugin
- 1.3.0
-
- myproject
-
-
-----
-
-Then deploy with `mvn appengine:deploy` (if you need to authenticate first, the build fails).
-
-
-
-[[deployment.installing]]
-== Installing Spring Boot Applications
-In addition to running Spring Boot applications by using `java -jar`, it is also possible to make fully executable applications for Unix systems.
-A fully executable jar can be executed like any other executable binary or it can be <>.
-This helps when installing and managing Spring Boot applications in common production environments.
-
-CAUTION: Fully executable jars work by embedding an extra script at the front of the file.
-Currently, some tools do not accept this format, so you may not always be able to use this technique.
-For example, `jar -xf` may silently fail to extract a jar or war that has been made fully executable.
-It is recommended that you make your jar or war fully executable only if you intend to execute it directly, rather than running it with `java -jar` or deploying it to a servlet container.
-
-CAUTION: A zip64-format jar file cannot be made fully executable.
-Attempting to do so will result in a jar file that is reported as corrupt when executed directly or with `java -jar`.
-A standard-format jar file that contains one or more zip64-format nested jars can be fully executable.
-
-To create a '`fully executable`' jar with Maven, use the following plugin configuration:
-
-[source,xml,indent=0,subs="verbatim,quotes,attributes"]
-----
-
- org.springframework.boot
- spring-boot-maven-plugin
-
- true
-
-
-----
-
-The following example shows the equivalent Gradle configuration:
-
-[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
-----
- bootJar {
- launchScript()
- }
-----
-
-You can then run your application by typing `./my-application.jar` (where `my-application` is the name of your artifact).
-The directory containing the jar is used as your application's working directory.
-
-
-
-[[deployment.installing.supported-operating-systems]]
-=== Supported Operating Systems
-The default script supports most Linux distributions and is tested on CentOS and Ubuntu.
-Other platforms, such as OS X and FreeBSD, require the use of a custom `embeddedLaunchScript`.
-
-
-
-[[deployment.installing.nix-services]]
-=== Unix/Linux Services
-Spring Boot application can be easily started as Unix/Linux services by using either `init.d` or `systemd`.
-
-
-
-[[deployment.installing.nix-services.init-d]]
-==== Installation as an init.d Service (System V)
-If you configured Spring Boot's Maven or Gradle plugin to generate a <>, and you do not use a custom `embeddedLaunchScript`, your application can be used as an `init.d` service.
-To do so, symlink the jar to `init.d` to support the standard `start`, `stop`, `restart`, and `status` commands.
-
-The script supports the following features:
-
-* Starts the services as the user that owns the jar file
-* Tracks the application's PID by using `/var/run//.pid`
-* Writes console logs to `/var/log/.log`
-
-Assuming that you have a Spring Boot application installed in `/var/myapp`, to install a Spring Boot application as an `init.d` service, create a symlink, as follows:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ sudo ln -s /var/myapp/myapp.jar /etc/init.d/myapp
-----
-
-Once installed, you can start and stop the service in the usual way.
-For example, on a Debian-based system, you could start it with the following command:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ service myapp start
-----
-
-TIP: If your application fails to start, check the log file written to `/var/log/.log` for errors.
-
-You can also flag the application to start automatically by using your standard operating system tools.
-For example, on Debian, you could use the following command:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ update-rc.d myapp defaults
-----
-
-
-
-[[deployment.installing.nix-services.init-d.securing]]
-===== Securing an init.d Service
-NOTE: The following is a set of guidelines on how to secure a Spring Boot application that runs as an init.d service.
-It is not intended to be an exhaustive list of everything that should be done to harden an application and the environment in which it runs.
-
-When executed as root, as is the case when root is being used to start an init.d service, the default executable script runs the application as the user specified in the `RUN_AS_USER` environment variable.
-When the environment variable is not set, the user who owns the jar file is used instead.
-You should never run a Spring Boot application as `root`, so `RUN_AS_USER` should never be root and your application's jar file should never be owned by root.
-Instead, create a specific user to run your application and set the `RUN_AS_USER` environment variable or use `chown` to make it the owner of the jar file, as shown in the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ chown bootapp:bootapp your-app.jar
-----
-
-In this case, the default executable script runs the application as the `bootapp` user.
-
-TIP: To reduce the chances of the application's user account being compromised, you should consider preventing it from using a login shell.
-For example, you can set the account's shell to `/usr/sbin/nologin`.
-
-You should also take steps to prevent the modification of your application's jar file.
-Firstly, configure its permissions so that it cannot be written and can only be read or executed by its owner, as shown in the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ chmod 500 your-app.jar
-----
-
-Second, you should also take steps to limit the damage if your application or the account that's running it is compromised.
-If an attacker does gain access, they could make the jar file writable and change its contents.
-One way to protect against this is to make it immutable by using `chattr`, as shown in the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ sudo chattr +i your-app.jar
-----
-
-This will prevent any user, including root, from modifying the jar.
-
-If root is used to control the application's service and you <> to customize its startup, the `.conf` file is read and evaluated by the root user.
-It should be secured accordingly.
-Use `chmod` so that the file can only be read by the owner and use `chown` to make root the owner, as shown in the following example:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ chmod 400 your-app.conf
- $ sudo chown root:root your-app.conf
-----
-
-
-
-[[deployment.installing.nix-services.system-d]]
-==== Installation as a systemd Service
-`systemd` is the successor of the System V init system and is now being used by many modern Linux distributions.
-Although you can continue to use `init.d` scripts with `systemd`, it is also possible to launch Spring Boot applications by using `systemd` '`service`' scripts.
-
-Assuming that you have a Spring Boot application installed in `/var/myapp`, to install a Spring Boot application as a `systemd` service, create a script named `myapp.service` and place it in `/etc/systemd/system` directory.
-The following script offers an example:
-
-[indent=0]
-----
- [Unit]
- Description=myapp
- After=syslog.target
-
- [Service]
- User=myapp
- ExecStart=/var/myapp/myapp.jar
- SuccessExitStatus=143
-
- [Install]
- WantedBy=multi-user.target
-----
-
-IMPORTANT: Remember to change the `Description`, `User`, and `ExecStart` fields for your application.
-
-NOTE: The `ExecStart` field does not declare the script action command, which means that the `run` command is used by default.
-
-Note that, unlike when running as an `init.d` service, the user that runs the application, the PID file, and the console log file are managed by `systemd` itself and therefore must be configured by using appropriate fields in the '`service`' script.
-Consult the https://www.freedesktop.org/software/systemd/man/systemd.service.html[service unit configuration man page] for more details.
-
-To flag the application to start automatically on system boot, use the following command:
-
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- $ systemctl enable myapp.service
-----
-
-Refer to `man systemctl` for more details.
-
-
-
-[[deployment.installing.nix-services.script-customization]]
-==== Customizing the Startup Script
-The default embedded startup script written by the Maven or Gradle plugin can be customized in a number of ways.
-For most people, using the default script along with a few customizations is usually enough.
-If you find you cannot customize something that you need to, use the `embeddedLaunchScript` option to write your own file entirely.
-
-
-
-[[deployment.installing.nix-services.script-customization.when-written]]
-===== Customizing the Start Script When It Is Written
-It often makes sense to customize elements of the start script as it is written into the jar file.
-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-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:
-
-[cols="1,3,3,3"]
-|===
-| Name | Description | Gradle default | Maven default
-
-| `mode`
-| The script mode.
-| `auto`
-| `auto`
-
-| `initInfoProvides`
-| The `Provides` section of "`INIT INFO`"
-| `${task.baseName}`
-| `${project.artifactId}`
-
-| `initInfoRequiredStart`
-| `Required-Start` section of "`INIT INFO`".
-| `$remote_fs $syslog $network`
-| `$remote_fs $syslog $network`
-
-| `initInfoRequiredStop`
-| `Required-Stop` section of "`INIT INFO`".
-| `$remote_fs $syslog $network`
-| `$remote_fs $syslog $network`
-
-| `initInfoDefaultStart`
-| `Default-Start` section of "`INIT INFO`".
-| `2 3 4 5`
-| `2 3 4 5`
-
-| `initInfoDefaultStop`
-| `Default-Stop` section of "`INIT INFO`".
-| `0 1 6`
-| `0 1 6`
-
-| `initInfoShortDescription`
-| `Short-Description` section of "`INIT INFO`".
-| Single-line version of `${project.description}` (falling back to `${task.baseName}`)
-| `${project.name}`
-
-| `initInfoDescription`
-| `Description` section of "`INIT INFO`".
-| `${project.description}` (falling back to `${task.baseName}`)
-| `${project.description}` (falling back to `${project.name}`)
-
-| `initInfoChkconfig`
-| `chkconfig` section of "`INIT INFO`"
-| `2345 99 01`
-| `2345 99 01`
-
-| `confFolder`
-| The default value for `CONF_FOLDER`
-| Folder containing the jar
-| Folder containing the jar
-
-| `inlinedConfScript`
-| Reference to a file script that should be inlined in the default launch script.
- This can be used to set environmental variables such as `JAVA_OPTS` before any external config files are loaded
-|
-|
-
-| `logFolder`
-| Default value for `LOG_FOLDER`.
- Only valid for an `init.d` service
-|
-|
-
-| `logFilename`
-| Default value for `LOG_FILENAME`.
- Only valid for an `init.d` service
-|
-|
-
-| `pidFolder`
-| Default value for `PID_FOLDER`.
- Only valid for an `init.d` service
-|
-|
-
-| `pidFilename`
-| Default value for the name of the PID file in `PID_FOLDER`.
- Only valid for an `init.d` service
-|
-|
-
-| `useStartStopDaemon`
-| Whether the `start-stop-daemon` command, when it's available, should be used to control the process
-| `true`
-| `true`
-
-| `stopWaitTime`
-| Default value for `STOP_WAIT_TIME` in seconds.
- Only valid for an `init.d` service
-| 60
-| 60
-|===
-
-
-
-[[deployment.installing.nix-services.script-customization.when-running]]
-===== Customizing a Script When It Runs
-For items of the script that need to be customized _after_ the jar has been written, you can use environment variables or a <>.
-
-The following environment properties are supported with the default script:
-
-[cols="1,6"]
-|===
-| Variable | Description
-
-| `MODE`
-| The "`mode`" of operation.
- The default depends on the way the jar was built but is usually `auto` (meaning it tries to guess if it is an init script by checking if it is a symlink in a directory called `init.d`).
- You can explicitly set it to `service` so that the `stop\|start\|status\|restart` commands work or to `run` if you want to run the script in the foreground.
-
-| `RUN_AS_USER`
-| The user that will be used to run the application.
- When not set, the user that owns the jar file will be used.
-
-| `USE_START_STOP_DAEMON`
-| Whether the `start-stop-daemon` command, when it's available, should be used to control the process.
- Defaults to `true`.
-
-| `PID_FOLDER`
-| The root name of the pid folder (`/var/run` by default).
-
-| `LOG_FOLDER`
-| The name of the folder in which to put log files (`/var/log` by default).
-
-| `CONF_FOLDER`
-| The name of the folder from which to read .conf files (same folder as jar-file by default).
-
-| `LOG_FILENAME`
-| The name of the log file in the `LOG_FOLDER` (`.log` by default).
-
-| `APP_NAME`
-| The name of the app.
- If the jar is run from a symlink, the script guesses the app name.
- If it is not a symlink or you want to explicitly set the app name, this can be useful.
-
-| `RUN_ARGS`
-| The arguments to pass to the program (the Spring Boot app).
-
-| `JAVA_HOME`
-| The location of the `java` executable is discovered by using the `PATH` by default, but you can set it explicitly if there is an executable file at `$JAVA_HOME/bin/java`.
-
-| `JAVA_OPTS`
-| Options that are passed to the JVM when it is launched.
-
-| `JARFILE`
-| The explicit location of the jar file, in case the script is being used to launch a jar that it is not actually embedded.
-
-| `DEBUG`
-| If not empty, sets the `-x` flag on the shell process, allowing you to see the logic in the script.
-
-| `STOP_WAIT_TIME`
-| The time in seconds to wait when stopping the application before forcing a shutdown (`60` by default).
-|===
-
-NOTE: The `PID_FOLDER`, `LOG_FOLDER`, and `LOG_FILENAME` variables are only valid for an `init.d` service.
-For `systemd`, the equivalent customizations are made by using the '`service`' script.
-See the https://www.freedesktop.org/software/systemd/man/systemd.service.html[service unit configuration man page] for more details.
-
-
-
-[[deployment-script-customization-conf-file]]
-With the exception of `JARFILE` and `APP_NAME`, the settings listed in the preceding section can be configured by using a `.conf` file.
-The file is expected to be next to the jar file and have the same name but suffixed with `.conf` rather than `.jar`.
-For example, a jar named `/var/myapp/myapp.jar` uses the configuration file named `/var/myapp/myapp.conf`, as shown in the following example:
-
-.myapp.conf
-[indent=0,subs="verbatim,quotes,attributes"]
-----
- JAVA_OPTS=-Xmx1024M
- LOG_FOLDER=/custom/log/folder
-----
-
-TIP: If you do not like having the config file next to the jar file, you can set a `CONF_FOLDER` environment variable to customize the location of the config file.
-
-To learn about securing this file appropriately, see <>.
-
-
-
-[[deployment.installing.windows-services]]
-=== Microsoft Windows Services
-A Spring Boot application can be started as a Windows service by using https://github.com/kohsuke/winsw[`winsw`].
-
-A (https://github.com/snicoll/spring-boot-daemon[separately maintained sample]) describes step-by-step how you can create a Windows service for your Spring Boot application.
-
-
-
-[[deployment.whats-next]]
-== What to Read Next
-Check out the https://www.cloudfoundry.org/[Cloud Foundry], https://www.heroku.com/[Heroku], https://www.openshift.com[OpenShift], and https://boxfuse.com[Boxfuse] web sites for more information about the kinds of features that a PaaS can offer.
-These are just four of the most popular Java PaaS providers.
-Since Spring Boot is so amenable to cloud-based deployment, you can freely consider other providers as well.
-
-The next section goes on to cover the _<>_, or you can jump ahead to read about _<>_.
+include::deployment/whats-next.adoc[]
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/cloud.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/cloud.adoc
new file mode 100644
index 0000000000..f9e2fe3964
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/cloud.adoc
@@ -0,0 +1,415 @@
+[[deployment.cloud]]
+== Deploying to the Cloud
+Spring Boot's executable jars are ready-made for most popular cloud PaaS (Platform-as-a-Service) providers.
+These providers tend to require that you "`bring your own container`".
+They manage application processes (not Java applications specifically), so they need an intermediary layer that adapts _your_ application to the _cloud's_ notion of a running process.
+
+Two popular cloud providers, Heroku and Cloud Foundry, employ a "`buildpack`" approach.
+The buildpack wraps your deployed code in whatever is needed to _start_ your application.
+It might be a JDK and a call to `java`, an embedded web server, or a full-fledged application server.
+A buildpack is pluggable, but ideally you should be able to get by with as few customizations to it as possible.
+This reduces the footprint of functionality that is not under your control.
+It minimizes divergence between development and production environments.
+
+Ideally, your application, like a Spring Boot executable jar, has everything that it needs to run packaged within it.
+
+In this section, we look at what it takes to get the <> in the "`Getting Started`" section up and running in the Cloud.
+
+
+
+[[deployment.cloud.cloud-foundry]]
+=== Cloud Foundry
+Cloud Foundry provides default buildpacks that come into play if no other buildpack is specified.
+The Cloud Foundry https://github.com/cloudfoundry/java-buildpack[Java buildpack] has excellent support for Spring applications, including Spring Boot.
+You can deploy stand-alone executable jar applications as well as traditional `.war` packaged applications.
+
+Once you have built your application (by using, for example, `mvn clean package`) and have https://docs.cloudfoundry.org/cf-cli/install-go-cli.html[installed the `cf` command line tool], deploy your application by using the `cf push` command, substituting the path to your compiled `.jar`.
+Be sure to have https://docs.cloudfoundry.org/cf-cli/getting-started.html#login[logged in with your `cf` command line client] before pushing an application.
+The following line shows using the `cf push` command to deploy an application:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ cf push acloudyspringtime -p target/demo-0.0.1-SNAPSHOT.jar
+----
+
+NOTE: In the preceding example, we substitute `acloudyspringtime` for whatever value you give `cf` as the name of your application.
+
+See the https://docs.cloudfoundry.org/cf-cli/getting-started.html#push[`cf push` documentation] for more options.
+If there is a Cloud Foundry https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html[`manifest.yml`] file present in the same directory, it is considered.
+
+At this point, `cf` starts uploading your application, producing output similar to the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ Uploading acloudyspringtime... *OK*
+ Preparing to start acloudyspringtime... *OK*
+ -----> Downloaded app package (*8.9M*)
+ -----> Java Buildpack Version: v3.12 (offline) | https://github.com/cloudfoundry/java-buildpack.git#6f25b7e
+ -----> Downloading Open Jdk JRE 1.8.0_121 from https://java-buildpack.cloudfoundry.org/openjdk/trusty/x86_64/openjdk-1.8.0_121.tar.gz (found in cache)
+ Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.6s)
+ -----> Downloading Open JDK Like Memory Calculator 2.0.2_RELEASE from https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/memory-calculator-2.0.2_RELEASE.tar.gz (found in cache)
+ Memory Settings: -Xss349K -Xmx681574K -XX:MaxMetaspaceSize=104857K -Xms681574K -XX:MetaspaceSize=104857K
+ -----> Downloading Container Certificate Trust Store 1.0.0_RELEASE from https://java-buildpack.cloudfoundry.org/container-certificate-trust-store/container-certificate-trust-store-1.0.0_RELEASE.jar (found in cache)
+ Adding certificates to .java-buildpack/container_certificate_trust_store/truststore.jks (0.6s)
+ -----> Downloading Spring Auto Reconfiguration 1.10.0_RELEASE from https://java-buildpack.cloudfoundry.org/auto-reconfiguration/auto-reconfiguration-1.10.0_RELEASE.jar (found in cache)
+ Checking status of app 'acloudyspringtime'...
+ 0 of 1 instances running (1 starting)
+ ...
+ 0 of 1 instances running (1 starting)
+ ...
+ 0 of 1 instances running (1 starting)
+ ...
+ 1 of 1 instances running (1 running)
+
+ App started
+----
+
+Congratulations! The application is now live!
+
+Once your application is live, you can verify the status of the deployed application by using the `cf apps` command, as shown in the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ cf apps
+ Getting applications in ...
+ OK
+
+ name requested state instances memory disk urls
+ ...
+ acloudyspringtime started 1/1 512M 1G acloudyspringtime.cfapps.io
+ ...
+----
+
+Once Cloud Foundry acknowledges that your application has been deployed, you should be able to find the application at the URI given.
+In the preceding example, you could find it at `\https://acloudyspringtime.cfapps.io/`.
+
+
+
+[[deployment.cloud.cloud-foundry.binding-to-services]]
+==== Binding to Services
+By default, metadata about the running application as well as service connection information is exposed to the application as environment variables (for example: `$VCAP_SERVICES`).
+This architecture decision is due to Cloud Foundry's polyglot (any language and platform can be supported as a buildpack) nature.
+Process-scoped environment variables are language agnostic.
+
+Environment variables do not always make for the easiest API, so Spring Boot automatically extracts them and flattens the data into properties that can be accessed through Spring's `Environment` abstraction, as shown in the following example:
+
+[source,java,pending-extract=true,indent=0]
+----
+ @Component
+ class MyBean implements EnvironmentAware {
+
+ private String instanceId;
+
+ @Override
+ public void setEnvironment(Environment environment) {
+ this.instanceId = environment.getProperty("vcap.application.instance_id");
+ }
+
+ // ...
+
+ }
+----
+
+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 {spring-boot-module-api}/cloud/CloudFoundryVcapEnvironmentPostProcessor.html['`CloudFoundryVcapEnvironmentPostProcessor`'] Javadoc for complete details.
+
+TIP: The https://github.com/pivotal-cf/java-cfenv/[Java CFEnv] project is a better fit for tasks such as configuring a DataSource.
+
+
+
+[[deployment.cloud.kubernetes]]
+=== Kubernetes
+Spring Boot auto-detects Kubernetes deployment environments by checking the environment for `"*_SERVICE_HOST"` and `"*_SERVICE_PORT"` variables.
+You can override this detection with the configprop:spring.main.cloud-platform[] configuration property.
+
+Spring Boot helps you to <> and export it with <>.
+
+
+
+[[deployment.cloud.kubernetes.container-lifecycle]]
+==== Kubernetes Container Lifecycle
+When Kubernetes deletes an application instance, the shutdown process involves several subsystems concurrently: shutdown hooks, unregistering the service, removing the instance from the load-balancer...
+Because this shutdown processing happens in parallel (and due to the nature of distributed systems), there is a window during which traffic can be routed to a pod that has also begun its shutdown processing.
+
+You can configure a sleep execution in a preStop handler to avoid requests being routed to a pod that has already begun shutting down.
+This sleep should be long enough for new requests to stop being routed to the pod and its duration will vary from deployment to deployment.
+The preStop handler can be configured via the PodSpec in the pod's configuration file as follows:
+
+[source,yml,indent=0]
+----
+spec:
+ containers:
+ - name: example-container
+ image: example-image
+ lifecycle:
+ preStop:
+ exec:
+ command: ["sh", "-c", "sleep 10"]
+----
+
+Once the pre-stop hook has completed, SIGTERM will be sent to the container and <> will begin, allowing any remaining in-flight requests to complete.
+
+
+
+[[deployment.cloud.heroku]]
+=== Heroku
+Heroku is another popular PaaS platform.
+To customize Heroku builds, you provide a `Procfile`, which provides the incantation required to deploy an application.
+Heroku assigns a `port` for the Java application to use and then ensures that routing to the external URI works.
+
+You must configure your application to listen on the correct port.
+The following example shows the `Procfile` for our starter REST application:
+
+[indent=0]
+----
+ web: java -Dserver.port=$PORT -jar target/demo-0.0.1-SNAPSHOT.jar
+----
+
+Spring Boot makes `-D` arguments available as properties accessible from a Spring `Environment` instance.
+The `server.port` configuration property is fed to the embedded Tomcat, Jetty, or Undertow instance, which then uses the port when it starts up.
+The `$PORT` environment variable is assigned to us by the Heroku PaaS.
+
+This should be everything you need.
+The most common deployment workflow for Heroku deployments is to `git push` the code to production, as shown in the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ git push heroku main
+
+ Initializing repository, *done*.
+ Counting objects: 95, *done*.
+ Delta compression using up to 8 threads.
+ Compressing objects: 100% (78/78), *done*.
+ Writing objects: 100% (95/95), 8.66 MiB | 606.00 KiB/s, *done*.
+ Total 95 (delta 31), reused 0 (delta 0)
+
+ -----> Java app detected
+ -----> Installing OpenJDK 1.8... *done*
+ -----> Installing Maven 3.3.1... *done*
+ -----> Installing settings.xml... *done*
+ -----> Executing: mvn -B -DskipTests=true clean install
+
+ [INFO] Scanning for projects...
+ Downloading: https://repo.spring.io/...
+ Downloaded: https://repo.spring.io/... (818 B at 1.8 KB/sec)
+ ....
+ Downloaded: https://s3pository.heroku.com/jvm/... (152 KB at 595.3 KB/sec)
+ [INFO] Installing /tmp/build_0c35a5d2-a067-4abc-a232-14b1fb7a8229/target/...
+ [INFO] Installing /tmp/build_0c35a5d2-a067-4abc-a232-14b1fb7a8229/pom.xml ...
+ [INFO] ------------------------------------------------------------------------
+ [INFO] *BUILD SUCCESS*
+ [INFO] ------------------------------------------------------------------------
+ [INFO] Total time: 59.358s
+ [INFO] Finished at: Fri Mar 07 07:28:25 UTC 2014
+ [INFO] Final Memory: 20M/493M
+ [INFO] ------------------------------------------------------------------------
+
+ -----> Discovering process types
+ Procfile declares types -> *web*
+
+ -----> Compressing... *done*, 70.4MB
+ -----> Launching... *done*, v6
+ https://agile-sierra-1405.herokuapp.com/ *deployed to Heroku*
+
+ To git@heroku.com:agile-sierra-1405.git
+ * [new branch] main -> main
+----
+
+Your application should now be up and running on Heroku.
+For more details, refer to https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku[Deploying Spring Boot Applications to Heroku].
+
+
+
+[[deployment.cloud.openshift]]
+=== OpenShift
+https://www.openshift.com/[OpenShift] has many resources describing how to deploy Spring Boot applications, including:
+
+* https://blog.openshift.com/using-openshift-enterprise-grade-spring-boot-deployments/[Using the S2I builder]
+* https://access.redhat.com/documentation/en-us/reference_architectures/2017/html-single/spring_boot_microservices_on_red_hat_openshift_container_platform_3/[Architecture guide]
+* https://blog.openshift.com/using-spring-boot-on-openshift/[Running as a traditional web application on Wildfly]
+* https://blog.openshift.com/openshift-commons-briefing-96-cloud-native-applications-spring-rhoar/[OpenShift Commons Briefing]
+
+
+
+[[deployment.cloud.aws]]
+=== Amazon Web Services (AWS)
+Amazon Web Services offers multiple ways to install Spring Boot-based applications, either as traditional web applications (war) or as executable jar files with an embedded web server.
+The options include:
+
+* AWS Elastic Beanstalk
+* AWS Code Deploy
+* AWS OPS Works
+* AWS Cloud Formation
+* AWS Container Registry
+
+Each has different features and pricing models.
+In this document, we describe to approach using AWS Elastic Beanstalk.
+
+
+
+[[deployment.cloud.aws.beanstalk]]
+==== AWS Elastic Beanstalk
+As described in the official https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Java.html[Elastic Beanstalk Java guide], there are two main options to deploy a Java application.
+You can either use the "`Tomcat Platform`" or the "`Java SE platform`".
+
+
+
+[[deployment.cloud.aws.beanstalk.tomcat-platform]]
+===== Using the Tomcat Platform
+This option applies to Spring Boot projects that produce a war file.
+No special configuration is required.
+You need only follow the official guide.
+
+
+
+[[deployment.cloud.aws.beanstalk.java-se-platform]]
+===== Using the Java SE Platform
+This option applies to Spring Boot projects that produce a jar file and run an embedded web container.
+Elastic Beanstalk environments run an nginx instance on port 80 to proxy the actual application, running on port 5000.
+To configure it, add the following line to your `application.properties` file:
+
+[indent=0]
+----
+ server.port=5000
+----
+
+
+[TIP]
+.Upload binaries instead of sources
+====
+By default, Elastic Beanstalk uploads sources and compiles them in AWS.
+However, it is best to upload the binaries instead.
+To do so, add lines similar to the following to your `.elasticbeanstalk/config.yml` file:
+
+[source,xml,indent=0,subs="verbatim,quotes,attributes"]
+----
+ deploy:
+ artifact: target/demo-0.0.1-SNAPSHOT.jar
+----
+====
+
+[TIP]
+.Reduce costs by setting the environment type
+====
+By default an Elastic Beanstalk environment is load balanced.
+The load balancer has a significant cost.
+To avoid that cost, set the environment type to "`Single instance`", as described in https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-create-wizard.html#environments-create-wizard-capacity[the Amazon documentation].
+You can also create single instance environments by using the CLI and the following command:
+
+[indent=0]
+----
+ eb create -s
+----
+====
+
+
+
+[[deployment.cloud.aws.summary]]
+==== Summary
+This is one of the easiest ways to get to AWS, but there are more things to cover, such as how to integrate Elastic Beanstalk into any CI / CD tool, use the Elastic Beanstalk Maven plugin instead of the CLI, and others.
+There is a https://exampledriven.wordpress.com/2017/01/09/spring-boot-aws-elastic-beanstalk-example/[blog post] covering these topics more in detail.
+
+
+
+[[deployment.cloud.boxfuse]]
+=== Boxfuse and Amazon Web Services
+https://boxfuse.com/[Boxfuse] works by turning your Spring Boot executable jar or war into a minimal VM image that can be deployed unchanged either on VirtualBox or on AWS.
+Boxfuse comes with deep integration for Spring Boot and uses the information from your Spring Boot configuration file to automatically configure ports and health check URLs.
+Boxfuse leverages this information both for the images it produces as well as for all the resources it provisions (instances, security groups, elastic load balancers, and so on).
+
+Once you have created a https://console.boxfuse.com[Boxfuse account], connected it to your AWS account, installed the latest version of the Boxfuse Client, and ensured that the application has been built by Maven or Gradle (by using, for example, `mvn clean package`), you can deploy your Spring Boot application to AWS with a command similar to the following:
+
+[indent=0]
+----
+ $ boxfuse run myapp-1.0.jar -env=prod
+----
+
+See the https://boxfuse.com/docs/commandline/run.html[`boxfuse run` documentation] for more options.
+If there is a https://boxfuse.com/docs/commandline/#configuration[`boxfuse.conf`] file present in the current directory, it is considered.
+
+TIP: By default, Boxfuse activates a Spring profile named `boxfuse` on startup.
+If your executable jar or war contains an https://boxfuse.com/docs/payloads/springboot.html#configuration[`application-boxfuse.properties`] file, Boxfuse bases its configuration on the properties it contains.
+
+At this point, `boxfuse` creates an image for your application, uploads it, and configures and starts the necessary resources on AWS, resulting in output similar to the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ Fusing Image for myapp-1.0.jar ...
+ Image fused in 00:06.838s (53937 K) -> axelfontaine/myapp:1.0
+ Creating axelfontaine/myapp ...
+ Pushing axelfontaine/myapp:1.0 ...
+ Verifying axelfontaine/myapp:1.0 ...
+ Creating Elastic IP ...
+ Mapping myapp-axelfontaine.boxfuse.io to 52.28.233.167 ...
+ Waiting for AWS to create an AMI for axelfontaine/myapp:1.0 in eu-central-1 (this may take up to 50 seconds) ...
+ AMI created in 00:23.557s -> ami-d23f38cf
+ Creating security group boxfuse-sg_axelfontaine/myapp:1.0 ...
+ Launching t2.micro instance of axelfontaine/myapp:1.0 (ami-d23f38cf) in eu-central-1 ...
+ Instance launched in 00:30.306s -> i-92ef9f53
+ Waiting for AWS to boot Instance i-92ef9f53 and Payload to start at https://52.28.235.61/ ...
+ Payload started in 00:29.266s -> https://52.28.235.61/
+ Remapping Elastic IP 52.28.233.167 to i-92ef9f53 ...
+ Waiting 15s for AWS to complete Elastic IP Zero Downtime transition ...
+ Deployment completed successfully. axelfontaine/myapp:1.0 is up and running at https://myapp-axelfontaine.boxfuse.io/
+----
+
+Your application should now be up and running on AWS.
+
+See the blog post on https://boxfuse.com/blog/spring-boot-ec2.html[deploying Spring Boot apps on EC2] as well as the https://boxfuse.com/docs/payloads/springboot.html[documentation for the Boxfuse Spring Boot integration] to get started with a Maven build to run the app.
+
+
+
+[[deployment.cloud.google]]
+=== Google Cloud
+Google Cloud has several options that can be used to launch Spring Boot applications.
+The easiest to get started with is probably App Engine, but you could also find ways to run Spring Boot in a container with Container Engine or on a virtual machine with Compute Engine.
+
+To run in App Engine, you can create a project in the UI first, which sets up a unique identifier for you and also sets up HTTP routes.
+Add a Java app to the project and leave it empty and then use the https://cloud.google.com/sdk/install[Google Cloud SDK] to push your Spring Boot app into that slot from the command line or CI build.
+
+App Engine Standard requires you to use WAR packaging.
+Follow https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/appengine-java8/springboot-helloworld/README.md[these steps] to deploy App Engine Standard application to Google Cloud.
+
+Alternatively, App Engine Flex requires you to create an `app.yaml` file to describe the resources your app requires.
+Normally, you put this file in `src/main/appengine`, and it should resemble the following file:
+
+[source,yaml,indent=0]
+----
+ service: default
+
+ runtime: java
+ env: flex
+
+ runtime_config:
+ jdk: openjdk8
+
+ handlers:
+ - url: /.*
+ script: this field is required, but ignored
+
+ manual_scaling:
+ instances: 1
+
+ health_check:
+ enable_health_check: False
+
+ env_variables:
+ ENCRYPT_KEY: your_encryption_key_here
+----
+
+You can deploy the app (for example, with a Maven plugin) by adding the project ID to the build configuration, as shown in the following example:
+
+[source,xml,indent=0,subs="verbatim,quotes,attributes"]
+----
+
+ com.google.cloud.tools
+ appengine-maven-plugin
+ 1.3.0
+
+ myproject
+
+
+----
+
+Then deploy with `mvn appengine:deploy` (if you need to authenticate first, the build fails).
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/containers.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/containers.adoc
new file mode 100644
index 0000000000..be1979f124
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/containers.adoc
@@ -0,0 +1,28 @@
+[[deployment.containers]]
+== Deploying to Containers
+If you are running your application from a container, you can use an executable jar, but it is also often an advantage to explode it and run it in a different way.
+Certain PaaS implementations may also choose to unpack archives before they run.
+For example, Cloud Foundry operates this way.
+One way to run an unpacked archive is by starting the appropriate launcher, as follows:
+
+[indent=0]
+----
+ $ jar -xf myapp.jar
+ $ java org.springframework.boot.loader.JarLauncher
+----
+
+This is actually slightly faster on startup (depending on the size of the jar) than running from an unexploded archive.
+At runtime you shouldn't expect any differences.
+
+Once you have unpacked the jar file, you can also get an extra boost to startup time by running the app with its "natural" main method instead of the `JarLauncher`. For example:
+
+[indent=0]
+----
+ $ jar -xf myapp.jar
+ $ java -cp BOOT-INF/classes:BOOT-INF/lib/* com.example.MyApplication
+----
+
+NOTE: Using the `JarLauncher` over the application's main method has the added benefit of a predictable classpath order.
+The jar contains a `classpath.idx` file which is used by the `JarLauncher` when constructing the classpath.
+
+More efficient container images can also be created by <> for your dependencies and application classes and resources (which normally change more frequently).
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/installing.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/installing.adoc
new file mode 100644
index 0000000000..96fd61360c
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/installing.adoc
@@ -0,0 +1,389 @@
+[[deployment.installing]]
+== Installing Spring Boot Applications
+In addition to running Spring Boot applications by using `java -jar`, it is also possible to make fully executable applications for Unix systems.
+A fully executable jar can be executed like any other executable binary or it can be <>.
+This helps when installing and managing Spring Boot applications in common production environments.
+
+CAUTION: Fully executable jars work by embedding an extra script at the front of the file.
+Currently, some tools do not accept this format, so you may not always be able to use this technique.
+For example, `jar -xf` may silently fail to extract a jar or war that has been made fully executable.
+It is recommended that you make your jar or war fully executable only if you intend to execute it directly, rather than running it with `java -jar` or deploying it to a servlet container.
+
+CAUTION: A zip64-format jar file cannot be made fully executable.
+Attempting to do so will result in a jar file that is reported as corrupt when executed directly or with `java -jar`.
+A standard-format jar file that contains one or more zip64-format nested jars can be fully executable.
+
+To create a '`fully executable`' jar with Maven, use the following plugin configuration:
+
+[source,xml,indent=0,subs="verbatim,quotes,attributes"]
+----
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+ true
+
+
+----
+
+The following example shows the equivalent Gradle configuration:
+
+[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
+----
+ bootJar {
+ launchScript()
+ }
+----
+
+You can then run your application by typing `./my-application.jar` (where `my-application` is the name of your artifact).
+The directory containing the jar is used as your application's working directory.
+
+
+
+[[deployment.installing.supported-operating-systems]]
+=== Supported Operating Systems
+The default script supports most Linux distributions and is tested on CentOS and Ubuntu.
+Other platforms, such as OS X and FreeBSD, require the use of a custom `embeddedLaunchScript`.
+
+
+
+[[deployment.installing.nix-services]]
+=== Unix/Linux Services
+Spring Boot application can be easily started as Unix/Linux services by using either `init.d` or `systemd`.
+
+
+
+[[deployment.installing.nix-services.init-d]]
+==== Installation as an init.d Service (System V)
+If you configured Spring Boot's Maven or Gradle plugin to generate a <>, and you do not use a custom `embeddedLaunchScript`, your application can be used as an `init.d` service.
+To do so, symlink the jar to `init.d` to support the standard `start`, `stop`, `restart`, and `status` commands.
+
+The script supports the following features:
+
+* Starts the services as the user that owns the jar file
+* Tracks the application's PID by using `/var/run//.pid`
+* Writes console logs to `/var/log/.log`
+
+Assuming that you have a Spring Boot application installed in `/var/myapp`, to install a Spring Boot application as an `init.d` service, create a symlink, as follows:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ sudo ln -s /var/myapp/myapp.jar /etc/init.d/myapp
+----
+
+Once installed, you can start and stop the service in the usual way.
+For example, on a Debian-based system, you could start it with the following command:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ service myapp start
+----
+
+TIP: If your application fails to start, check the log file written to `/var/log/.log` for errors.
+
+You can also flag the application to start automatically by using your standard operating system tools.
+For example, on Debian, you could use the following command:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ update-rc.d myapp defaults
+----
+
+
+
+[[deployment.installing.nix-services.init-d.securing]]
+===== Securing an init.d Service
+NOTE: The following is a set of guidelines on how to secure a Spring Boot application that runs as an init.d service.
+It is not intended to be an exhaustive list of everything that should be done to harden an application and the environment in which it runs.
+
+When executed as root, as is the case when root is being used to start an init.d service, the default executable script runs the application as the user specified in the `RUN_AS_USER` environment variable.
+When the environment variable is not set, the user who owns the jar file is used instead.
+You should never run a Spring Boot application as `root`, so `RUN_AS_USER` should never be root and your application's jar file should never be owned by root.
+Instead, create a specific user to run your application and set the `RUN_AS_USER` environment variable or use `chown` to make it the owner of the jar file, as shown in the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ chown bootapp:bootapp your-app.jar
+----
+
+In this case, the default executable script runs the application as the `bootapp` user.
+
+TIP: To reduce the chances of the application's user account being compromised, you should consider preventing it from using a login shell.
+For example, you can set the account's shell to `/usr/sbin/nologin`.
+
+You should also take steps to prevent the modification of your application's jar file.
+Firstly, configure its permissions so that it cannot be written and can only be read or executed by its owner, as shown in the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ chmod 500 your-app.jar
+----
+
+Second, you should also take steps to limit the damage if your application or the account that's running it is compromised.
+If an attacker does gain access, they could make the jar file writable and change its contents.
+One way to protect against this is to make it immutable by using `chattr`, as shown in the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ sudo chattr +i your-app.jar
+----
+
+This will prevent any user, including root, from modifying the jar.
+
+If root is used to control the application's service and you <> to customize its startup, the `.conf` file is read and evaluated by the root user.
+It should be secured accordingly.
+Use `chmod` so that the file can only be read by the owner and use `chown` to make root the owner, as shown in the following example:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ chmod 400 your-app.conf
+ $ sudo chown root:root your-app.conf
+----
+
+
+
+[[deployment.installing.nix-services.system-d]]
+==== Installation as a systemd Service
+`systemd` is the successor of the System V init system and is now being used by many modern Linux distributions.
+Although you can continue to use `init.d` scripts with `systemd`, it is also possible to launch Spring Boot applications by using `systemd` '`service`' scripts.
+
+Assuming that you have a Spring Boot application installed in `/var/myapp`, to install a Spring Boot application as a `systemd` service, create a script named `myapp.service` and place it in `/etc/systemd/system` directory.
+The following script offers an example:
+
+[indent=0]
+----
+ [Unit]
+ Description=myapp
+ After=syslog.target
+
+ [Service]
+ User=myapp
+ ExecStart=/var/myapp/myapp.jar
+ SuccessExitStatus=143
+
+ [Install]
+ WantedBy=multi-user.target
+----
+
+IMPORTANT: Remember to change the `Description`, `User`, and `ExecStart` fields for your application.
+
+NOTE: The `ExecStart` field does not declare the script action command, which means that the `run` command is used by default.
+
+Note that, unlike when running as an `init.d` service, the user that runs the application, the PID file, and the console log file are managed by `systemd` itself and therefore must be configured by using appropriate fields in the '`service`' script.
+Consult the https://www.freedesktop.org/software/systemd/man/systemd.service.html[service unit configuration man page] for more details.
+
+To flag the application to start automatically on system boot, use the following command:
+
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ $ systemctl enable myapp.service
+----
+
+Refer to `man systemctl` for more details.
+
+
+
+[[deployment.installing.nix-services.script-customization]]
+==== Customizing the Startup Script
+The default embedded startup script written by the Maven or Gradle plugin can be customized in a number of ways.
+For most people, using the default script along with a few customizations is usually enough.
+If you find you cannot customize something that you need to, use the `embeddedLaunchScript` option to write your own file entirely.
+
+
+
+[[deployment.installing.nix-services.script-customization.when-written]]
+===== Customizing the Start Script When It Is Written
+It often makes sense to customize elements of the start script as it is written into the jar file.
+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-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:
+
+[cols="1,3,3,3"]
+|===
+| Name | Description | Gradle default | Maven default
+
+| `mode`
+| The script mode.
+| `auto`
+| `auto`
+
+| `initInfoProvides`
+| The `Provides` section of "`INIT INFO`"
+| `${task.baseName}`
+| `${project.artifactId}`
+
+| `initInfoRequiredStart`
+| `Required-Start` section of "`INIT INFO`".
+| `$remote_fs $syslog $network`
+| `$remote_fs $syslog $network`
+
+| `initInfoRequiredStop`
+| `Required-Stop` section of "`INIT INFO`".
+| `$remote_fs $syslog $network`
+| `$remote_fs $syslog $network`
+
+| `initInfoDefaultStart`
+| `Default-Start` section of "`INIT INFO`".
+| `2 3 4 5`
+| `2 3 4 5`
+
+| `initInfoDefaultStop`
+| `Default-Stop` section of "`INIT INFO`".
+| `0 1 6`
+| `0 1 6`
+
+| `initInfoShortDescription`
+| `Short-Description` section of "`INIT INFO`".
+| Single-line version of `${project.description}` (falling back to `${task.baseName}`)
+| `${project.name}`
+
+| `initInfoDescription`
+| `Description` section of "`INIT INFO`".
+| `${project.description}` (falling back to `${task.baseName}`)
+| `${project.description}` (falling back to `${project.name}`)
+
+| `initInfoChkconfig`
+| `chkconfig` section of "`INIT INFO`"
+| `2345 99 01`
+| `2345 99 01`
+
+| `confFolder`
+| The default value for `CONF_FOLDER`
+| Folder containing the jar
+| Folder containing the jar
+
+| `inlinedConfScript`
+| Reference to a file script that should be inlined in the default launch script.
+ This can be used to set environmental variables such as `JAVA_OPTS` before any external config files are loaded
+|
+|
+
+| `logFolder`
+| Default value for `LOG_FOLDER`.
+ Only valid for an `init.d` service
+|
+|
+
+| `logFilename`
+| Default value for `LOG_FILENAME`.
+ Only valid for an `init.d` service
+|
+|
+
+| `pidFolder`
+| Default value for `PID_FOLDER`.
+ Only valid for an `init.d` service
+|
+|
+
+| `pidFilename`
+| Default value for the name of the PID file in `PID_FOLDER`.
+ Only valid for an `init.d` service
+|
+|
+
+| `useStartStopDaemon`
+| Whether the `start-stop-daemon` command, when it's available, should be used to control the process
+| `true`
+| `true`
+
+| `stopWaitTime`
+| Default value for `STOP_WAIT_TIME` in seconds.
+ Only valid for an `init.d` service
+| 60
+| 60
+|===
+
+
+
+[[deployment.installing.nix-services.script-customization.when-running]]
+===== Customizing a Script When It Runs
+For items of the script that need to be customized _after_ the jar has been written, you can use environment variables or a <>.
+
+The following environment properties are supported with the default script:
+
+[cols="1,6"]
+|===
+| Variable | Description
+
+| `MODE`
+| The "`mode`" of operation.
+ The default depends on the way the jar was built but is usually `auto` (meaning it tries to guess if it is an init script by checking if it is a symlink in a directory called `init.d`).
+ You can explicitly set it to `service` so that the `stop\|start\|status\|restart` commands work or to `run` if you want to run the script in the foreground.
+
+| `RUN_AS_USER`
+| The user that will be used to run the application.
+ When not set, the user that owns the jar file will be used.
+
+| `USE_START_STOP_DAEMON`
+| Whether the `start-stop-daemon` command, when it's available, should be used to control the process.
+ Defaults to `true`.
+
+| `PID_FOLDER`
+| The root name of the pid folder (`/var/run` by default).
+
+| `LOG_FOLDER`
+| The name of the folder in which to put log files (`/var/log` by default).
+
+| `CONF_FOLDER`
+| The name of the folder from which to read .conf files (same folder as jar-file by default).
+
+| `LOG_FILENAME`
+| The name of the log file in the `LOG_FOLDER` (`.log` by default).
+
+| `APP_NAME`
+| The name of the app.
+ If the jar is run from a symlink, the script guesses the app name.
+ If it is not a symlink or you want to explicitly set the app name, this can be useful.
+
+| `RUN_ARGS`
+| The arguments to pass to the program (the Spring Boot app).
+
+| `JAVA_HOME`
+| The location of the `java` executable is discovered by using the `PATH` by default, but you can set it explicitly if there is an executable file at `$JAVA_HOME/bin/java`.
+
+| `JAVA_OPTS`
+| Options that are passed to the JVM when it is launched.
+
+| `JARFILE`
+| The explicit location of the jar file, in case the script is being used to launch a jar that it is not actually embedded.
+
+| `DEBUG`
+| If not empty, sets the `-x` flag on the shell process, allowing you to see the logic in the script.
+
+| `STOP_WAIT_TIME`
+| The time in seconds to wait when stopping the application before forcing a shutdown (`60` by default).
+|===
+
+NOTE: The `PID_FOLDER`, `LOG_FOLDER`, and `LOG_FILENAME` variables are only valid for an `init.d` service.
+For `systemd`, the equivalent customizations are made by using the '`service`' script.
+See the https://www.freedesktop.org/software/systemd/man/systemd.service.html[service unit configuration man page] for more details.
+
+
+
+[[deployment.installing.nix-services.script-customization.when-running.conf-file]]
+With the exception of `JARFILE` and `APP_NAME`, the settings listed in the preceding section can be configured by using a `.conf` file.
+The file is expected to be next to the jar file and have the same name but suffixed with `.conf` rather than `.jar`.
+For example, a jar named `/var/myapp/myapp.jar` uses the configuration file named `/var/myapp/myapp.conf`, as shown in the following example:
+
+.myapp.conf
+[indent=0,subs="verbatim,quotes,attributes"]
+----
+ JAVA_OPTS=-Xmx1024M
+ LOG_FOLDER=/custom/log/folder
+----
+
+TIP: If you do not like having the config file next to the jar file, you can set a `CONF_FOLDER` environment variable to customize the location of the config file.
+
+To learn about securing this file appropriately, see <>.
+
+
+
+[[deployment.installing.windows-services]]
+=== Microsoft Windows Services
+A Spring Boot application can be started as a Windows service by using https://github.com/kohsuke/winsw[`winsw`].
+
+A (https://github.com/snicoll/spring-boot-daemon[separately maintained sample]) describes step-by-step how you can create a Windows service for your Spring Boot application.
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/whats-next.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/whats-next.adoc
new file mode 100644
index 0000000000..f755bb5664
--- /dev/null
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/whats-next.adoc
@@ -0,0 +1,7 @@
+[[deployment.whats-next]]
+== What to Read Next
+Check out the https://www.cloudfoundry.org/[Cloud Foundry], https://www.heroku.com/[Heroku], https://www.openshift.com[OpenShift], and https://boxfuse.com[Boxfuse] web sites for more information about the kinds of features that a PaaS can offer.
+These are just four of the most popular Java PaaS providers.
+Since Spring Boot is so amenable to cloud-based deployment, you can freely consider other providers as well.
+
+The next section goes on to cover the _<>_, or you can jump ahead to read about _<>_.
diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/documentation.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/documentation.adoc
index aea797e667..bce98f62d0 100644
--- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/documentation.adoc
+++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/documentation.adoc
@@ -1,107 +1,30 @@
+include::attributes.adoc[]
+
+
+
[[documentation]]
= Spring Boot Documentation
include::attributes.adoc[]
+
+
This section provides a brief overview of Spring Boot reference documentation.
It serves as a map for the rest of the document.
-[[documentation.about]]
-== About the Documentation
-The Spring Boot reference guide is available as:
+include::documentation/about.adoc[]
-* {spring-boot-docs}/html/[Multi-page HTML]
-* {spring-boot-docs}/htmlsingle/[Single page HTML]
-* {spring-boot-docs}/pdf/spring-boot-reference.pdf[PDF]
+include::documentation/getting-help.adoc[]
-The latest copy is available at {spring-boot-current-docs}.
+include::documentation/upgrading.adoc[]
-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.
+include::documentation/first-steps.adoc[]
+include::documentation/using.adoc[]
+include::documentation/features.adoc[]
-[[documentation.getting-help]]
-== Getting Help
-If you have trouble with Spring Boot, we would like to help.
+include::documentation/actuator.adoc[]
-* Try the <>.
- They provide solutions to the most common questions.
-* Learn the Spring basics.
- Spring Boot builds on many other Spring projects.
- Check the https://spring.io[spring.io] web-site for a wealth of reference documentation.
- If you are starting out with Spring, try one of the https://spring.io/guides[guides].
-* Ask a question.
- We monitor https://stackoverflow.com[stackoverflow.com] for questions tagged with https://stackoverflow.com/tags/spring-boot[`spring-boot`].
-* 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 {spring-boot-code}[get involved].
-
-
-
-[[documentation.upgrading]]
-== Upgrading From an Earlier Version
-Instructions for how to upgrade from earlier versions of Spring Boot are provided on the project {github-wiki}[wiki].
-Follow the links in the {github-wiki}#release-notes[release notes] section to find the version that you want to upgrade to.
-
-Upgrading instructions are always the first item in the release notes.
-If you are more than one release behind, please make sure that you also review the release notes of the versions that you jumped.
-
-You should always ensure that you are running a {github-wiki}/Supported-Versions[supported version] of Spring Boot.
-
-
-
-[[documentation.first-steps]]
-== First Steps
-If you are getting started with Spring Boot or 'Spring' in general, start with <>:
-
-* *From scratch:* <> | <> | <>
-* *Tutorial:* <> | <>
-* *Running your example:* <> | <>
-
-
-
-[[documentation.using]]
-== Working with Spring Boot
-Ready to actually start using Spring Boot? <>:
-
-* *Build systems:* <> | <> | <> | <>
-* *Best practices:* <> | <> | <> | <>
-* *Running your code:* <> | <> | <> | <>
-* *Packaging your app:* <>
-* *Spring Boot CLI:* <>
-
-
-
-[[documentation.features]]
-== Learning About Spring Boot Features
-Need more details about Spring Boot's core features?
-<