Polish documentation for xref hyperlink formatting consistency
This commit improves the consistency of xref link formatting (no quotes, italics, or other decoration) and uses automatic link text generation wherever possible.
This commit is contained in:
@@ -294,7 +294,7 @@ Information returned by the `/env`, `/configprops` and `/quartz` endpoints can b
|
||||
Values can only be viewed in an unsanitized form when:
|
||||
|
||||
- The `show-values` property has been set to something other than `NEVER`
|
||||
- No custom `xref:how-to:actuator.adoc#howto.actuator.customizing-sanitization[SanitizingFunction]` beans apply
|
||||
- No custom xref:how-to:actuator.adoc#howto.actuator.customizing-sanitization[`SanitizingFunction`] beans apply
|
||||
|
||||
The `show-values` property can be configured for sanitizable endpoints to one of the following values:
|
||||
|
||||
@@ -319,7 +319,7 @@ management:
|
||||
roles: "admin"
|
||||
----
|
||||
|
||||
NOTE: This example assumes that no `xref:how-to:actuator.adoc#howto.actuator.customizing-sanitization[SanitizingFunction]` beans have been defined.
|
||||
NOTE: This example assumes that no xref:how-to:actuator.adoc#howto.actuator.customizing-sanitization[`SanitizingFunction`] beans have been defined.
|
||||
|
||||
|
||||
|
||||
@@ -908,7 +908,7 @@ If you prefer not to include routing data sources in the indicator's output, set
|
||||
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 calls those probes and reacts to the result.
|
||||
|
||||
By default, Spring Boot manages your xref:features/spring-application.adoc#features.spring-application.application-availability[Application Availability State].
|
||||
By default, Spring Boot manages your xref:features/spring-application.adoc#features.spring-application.application-availability[Application Availability] state.
|
||||
If deployed in a Kubernetes environment, actuator gathers the "`Liveness`" and "`Readiness`" information from the `ApplicationAvailability` interface and uses that information in dedicated xref:actuator/endpoints.adoc#actuator.endpoints.health.auto-configured-health-indicators[health indicators]: `LivenessStateHealthIndicator` and `ReadinessStateHealthIndicator`.
|
||||
These indicators are shown on the global health endpoint (`"/actuator/health"`).
|
||||
They are also exposed as separate HTTP Probes by using xref:actuator/endpoints.adoc#actuator.endpoints.health.groups[health groups]: `"/actuator/health/liveness"` and `"/actuator/health/readiness"`.
|
||||
@@ -1062,7 +1062,7 @@ When a Spring Boot application shuts down:
|
||||
|The application context is closed and the application is shut down.
|
||||
|===
|
||||
|
||||
TIP: See xref:how-to:deployment/cloud.adoc#howto.deployment.cloud.kubernetes.container-lifecycle[Kubernetes container lifecycle section] for more information about Kubernetes deployment.
|
||||
TIP: See xref:how-to:deployment/cloud.adoc#howto.deployment.cloud.kubernetes.container-lifecycle[] for more information about Kubernetes deployment.
|
||||
|
||||
|
||||
|
||||
@@ -1170,7 +1170,7 @@ Another useful feature of the `info` endpoint is its ability to publish informat
|
||||
If a `GitProperties` bean is available, you can use the `info` endpoint 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 "xref:how-to:build.adoc#howto.build.generate-git-info[how to generate git information]" for more detail.
|
||||
See xref:how-to:build.adoc#howto.build.generate-git-info[] for more detail.
|
||||
|
||||
By default, the endpoint exposes `git.branch`, `git.commit.id`, and `git.commit.time` properties, if present.
|
||||
If you do not want any of these properties in the endpoint response, they need to be excluded from the `git.properties` file.
|
||||
@@ -1203,7 +1203,7 @@ If a `BuildProperties` bean is available, the `info` endpoint can also publish i
|
||||
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 "xref:how-to:build.adoc#howto.build.generate-info[how to generate build information]" for more details.
|
||||
See xref:how-to:build.adoc#howto.build.generate-info[] for more details.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,25 +3,25 @@
|
||||
|
||||
Spring Boot Actuator provides dependency management and auto-configuration for {url-micrometer-site}[Micrometer], an application metrics facade that supports {url-micrometer-docs}[numerous monitoring systems], including:
|
||||
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.appoptics[AppOptics]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.atlas[Atlas]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.datadog[Datadog]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.dynatrace[Dynatrace]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.elastic[Elastic]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.ganglia[Ganglia]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.graphite[Graphite]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.humio[Humio]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.influx[Influx]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.jmx[JMX]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.kairos[KairosDB]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.newrelic[New Relic]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.otlp[OpenTelemetry]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.prometheus[Prometheus]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.signalfx[SignalFx]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.simple[Simple (in-memory)]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.stackdriver[Stackdriver]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.statsd[StatsD]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.wavefront[Wavefront]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.appoptics[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.atlas[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.datadog[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.dynatrace[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.elastic[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.ganglia[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.graphite[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.humio[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.influx[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.jmx[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.kairos[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.newrelic[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.otlp[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.prometheus[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.signalfx[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.simple[] (in-memory)
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.stackdriver[]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.statsd[D]
|
||||
- xref:actuator/metrics.adoc#actuator.metrics.export.wavefront[]
|
||||
|
||||
TIP: To learn more about Micrometer's capabilities, see its {url-micrometer-docs}[reference documentation], in particular the {url-micrometer-docs-concepts}[concepts section].
|
||||
|
||||
@@ -1236,7 +1236,7 @@ configurable buffer length.
|
||||
| Publish a cumulative histogram with buckets defined by your service-level objectives.
|
||||
|===
|
||||
|
||||
For more details on the concepts behind `percentiles-histogram`, `percentiles`, and `slo`, see the {url-micrometer-docs-concepts}#_histograms_and_percentiles["`Histograms and percentiles`" section] of the Micrometer documentation.
|
||||
For more details on the concepts behind `percentiles-histogram`, `percentiles`, and `slo`, see the {url-micrometer-docs-concepts}#_histograms_and_percentiles[Histograms and percentiles] section of the Micrometer documentation.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ In the `spring-boot` module, you can find two classes to create files that are o
|
||||
|
||||
By default, these writers are not activated, but you can enable them:
|
||||
|
||||
* xref:actuator/process-monitoring.adoc#actuator.process-monitoring.configuration[By Extending Configuration]
|
||||
* xref:actuator/process-monitoring.adoc#actuator.process-monitoring.programmatically[Programmatically Enabling Process Monitoring]
|
||||
* xref:actuator/process-monitoring.adoc#actuator.process-monitoring.configuration[]
|
||||
* xref:actuator/process-monitoring.adoc#actuator.process-monitoring.programmatically[]
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ Spring Boot ships auto-configuration for the following tracers:
|
||||
== Getting Started
|
||||
|
||||
We need an example application that we can use to get started with tracing.
|
||||
For our purposes, the simple "`Hello World!`" web application that's covered in the "`xref:tutorial:first-application/index.adoc[Developing Your First Spring Boot Application]`" section will suffice.
|
||||
For our purposes, the simple "`Hello World!`" web application that's covered in the xref:tutorial:first-application/index.adoc[] section will suffice.
|
||||
We're going to use the OpenTelemetry tracer with Zipkin as trace backend.
|
||||
|
||||
To recap, our main application code looks like this:
|
||||
@@ -216,4 +216,4 @@ For the example above, setting this property to `baggage1` results in an MDC ent
|
||||
== Tests
|
||||
|
||||
Tracing components which are reporting data are not auto-configured when using `@SpringBootTest`.
|
||||
See xref:testing/spring-boot-applications.adoc#testing.spring-boot-applications.tracing[the testing section] for more details.
|
||||
See xref:testing/spring-boot-applications.adoc#testing.spring-boot-applications.tracing[] for more details.
|
||||
|
||||
@@ -193,7 +193,7 @@ As with `JdbcTemplate`, Spring Boot auto-configures a bean for you to inject the
|
||||
|
||||
include-code::MyBean[]
|
||||
|
||||
See the {url-spring-data-mongodb-javadoc}/org/springframework/data/mongodb/core/MongoOperations.html[`MongoOperations` Javadoc] for complete details.
|
||||
See the {url-spring-data-mongodb-javadoc}/org/springframework/data/mongodb/core/MongoOperations.html[`MongoOperations`] API documentation for complete details.
|
||||
|
||||
|
||||
|
||||
@@ -375,7 +375,7 @@ as shown in the following example:
|
||||
|
||||
include-code::MyBean[]
|
||||
|
||||
In the presence of `spring-data-elasticsearch` and Reactor, Spring Boot can also auto-configure a xref:data/nosql.adoc#data.nosql.elasticsearch.connecting-using-rest.reactiveclient[ReactiveElasticsearchClient] and a `ReactiveElasticsearchTemplate` as beans.
|
||||
In the presence of `spring-data-elasticsearch` and Reactor, Spring Boot can also auto-configure a xref:data/nosql.adoc#data.nosql.elasticsearch.connecting-using-rest.reactiveclient[`ReactiveElasticsearchClient`] and a `ReactiveElasticsearchTemplate` as beans.
|
||||
They are the reactive equivalent of the other REST clients.
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ The {url-spring-framework-site}[Spring Framework] provides extensive support for
|
||||
Java's `javax.sql.DataSource` interface provides a standard method of working with database connections.
|
||||
Traditionally, a `DataSource` uses a `URL` along with some credentials to establish a database connection.
|
||||
|
||||
TIP: See xref:how-to:data-access.adoc#howto.data-access.configure-custom-datasource[the "`How-to`" section] for more advanced examples, typically to take full control over the configuration of the DataSource.
|
||||
TIP: See the xref:how-to:data-access.adoc#howto.data-access.configure-custom-datasource[] section of the "`How-to Guides`" for more advanced examples, typically to take full control over the configuration of the DataSource.
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ It is often convenient to develop applications by using an in-memory embedded da
|
||||
Obviously, in-memory databases do not provide persistent storage.
|
||||
You need to populate your database when your application starts and be prepared to throw away data when your application ends.
|
||||
|
||||
TIP: The "`How-to`" section includes a xref:how-to:data-initialization.adoc[section on how to initialize a database].
|
||||
TIP: The "`How-to Guides`" section includes a xref:how-to:data-initialization.adoc[section on how to initialize a database].
|
||||
|
||||
Spring Boot can auto-configure embedded https://www.h2database.com[H2], https://hsqldb.org/[HSQL], and https://db.apache.org/derby/[Derby] databases.
|
||||
You need not provide any connection URLs.
|
||||
@@ -93,7 +93,7 @@ If you need to specify a specific class, you can use the configprop:spring.datas
|
||||
NOTE: For a pooling `DataSource` to be created, we need to be able to verify that a valid `Driver` class is available, so we check for that before doing anything.
|
||||
In other words, if you set `spring.datasource.driver-class-name=com.mysql.jdbc.Driver`, then that class has to be loadable.
|
||||
|
||||
See xref:api:java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.html[`DataSourceProperties`] for more of the supported options.
|
||||
See xref:api:java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.html[`DataSourceProperties`] API documentation for more of the supported options.
|
||||
These are the standard options that work regardless of xref:data/sql.adoc#data.sql.datasource.connection-pool[the actual implementation].
|
||||
It is also possible to fine-tune implementation-specific settings by using their respective prefix (`+spring.datasource.hikari.*+`, `+spring.datasource.tomcat.*+`, `+spring.datasource.dbcp2.*+`, and `+spring.datasource.oracleucp.*+`).
|
||||
See the documentation of the connection pool implementation you are using for more details.
|
||||
@@ -208,7 +208,7 @@ It provides the following key dependencies:
|
||||
* Spring ORM: Core ORM support from the Spring Framework.
|
||||
|
||||
TIP: We do not go into too many details of JPA or {url-spring-data-site}[Spring Data] here.
|
||||
You can follow the https://spring.io/guides/gs/accessing-data-jpa/["`Accessing Data with JPA`"] guide from https://spring.io and read the {url-spring-data-jpa-site}[Spring Data JPA] and https://hibernate.org/orm/documentation/[Hibernate] reference documentation.
|
||||
You can follow the https://spring.io/guides/gs/accessing-data-jpa/[Accessing Data with JPA] guide from https://spring.io and read the {url-spring-data-jpa-site}[Spring Data JPA] and https://hibernate.org/orm/documentation/[Hibernate] reference documentation.
|
||||
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ A typical entity class resembles the following example:
|
||||
include-code::City[]
|
||||
|
||||
TIP: You can customize entity scanning locations by using the `@EntityScan` annotation.
|
||||
See the "`xref:how-to:data-access.adoc#howto.data-access.separate-entity-definitions-from-spring-configuration[Separate @Entity Definitions from Spring Configuration]`" how-to.
|
||||
See the xref:how-to:data-access.adoc#howto.data-access.separate-entity-definitions-from-spring-configuration[] section of the "`How-to Guides`".
|
||||
|
||||
|
||||
|
||||
@@ -485,7 +485,7 @@ TIP: You do not need to specify a driver class name, since Spring Boot obtains t
|
||||
NOTE: At least the url should be provided.
|
||||
Information specified in the URL takes precedence over individual properties, that is `name`, `username`, `password` and pooling options.
|
||||
|
||||
TIP: The "`How-to`" section includes a xref:how-to:data-initialization.adoc#howto.data-initialization.using-basic-sql-scripts[section on how to initialize a database].
|
||||
TIP: The "`How-to Guides`" section includes a xref:how-to:data-initialization.adoc#howto.data-initialization.using-basic-sql-scripts[section on how to initialize a database].
|
||||
|
||||
To customize the connections created by a `ConnectionFactory`, that is, set specific parameters that you do not want (or cannot) configure in your central database configuration, you can use a `ConnectionFactoryOptionsBuilderCustomizer` `@Bean`.
|
||||
The following example shows how to manually override the database port while the rest of the options are taken from the application configuration:
|
||||
|
||||
@@ -61,12 +61,12 @@ The `@ConditionalOnMissingBean` annotation is one common example that is used to
|
||||
Spring Boot includes a number of `@Conditional` annotations that you can reuse in your own code by annotating `@Configuration` classes or individual `@Bean` methods.
|
||||
These annotations include:
|
||||
|
||||
* xref:features/developing-auto-configuration.adoc#features.developing-auto-configuration.condition-annotations.class-conditions[Class Conditions]
|
||||
* xref:features/developing-auto-configuration.adoc#features.developing-auto-configuration.condition-annotations.bean-conditions[Bean Conditions]
|
||||
* xref:features/developing-auto-configuration.adoc#features.developing-auto-configuration.condition-annotations.property-conditions[Property Conditions]
|
||||
* xref:features/developing-auto-configuration.adoc#features.developing-auto-configuration.condition-annotations.resource-conditions[Resource Conditions]
|
||||
* xref:features/developing-auto-configuration.adoc#features.developing-auto-configuration.condition-annotations.web-application-conditions[Web Application Conditions]
|
||||
* xref:features/developing-auto-configuration.adoc#features.developing-auto-configuration.condition-annotations.spel-conditions[SpEL Expression Conditions]
|
||||
* xref:features/developing-auto-configuration.adoc#features.developing-auto-configuration.condition-annotations.class-conditions[]
|
||||
* xref:features/developing-auto-configuration.adoc#features.developing-auto-configuration.condition-annotations.bean-conditions[]
|
||||
* xref:features/developing-auto-configuration.adoc#features.developing-auto-configuration.condition-annotations.property-conditions[]
|
||||
* xref:features/developing-auto-configuration.adoc#features.developing-auto-configuration.condition-annotations.resource-conditions[]
|
||||
* xref:features/developing-auto-configuration.adoc#features.developing-auto-configuration.condition-annotations.web-application-conditions[]
|
||||
* xref:features/developing-auto-configuration.adoc#features.developing-auto-configuration.condition-annotations.spel-conditions[]
|
||||
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ In particular, do not include your keys in the namespaces that Spring Boot uses
|
||||
If you use the same namespace, we may modify these namespaces in the future in ways that break your modules.
|
||||
As a rule of thumb, prefix all your keys with a namespace that you own (for example `acme`).
|
||||
|
||||
Make sure that configuration keys are documented by adding field javadoc for each property, as shown in the following example:
|
||||
Make sure that configuration keys are documented by adding field Javadoc for each property, as shown in the following example:
|
||||
|
||||
include-code::AcmeProperties[]
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ NOTE: It is recommended to stick with one format for your entire application.
|
||||
If you have configuration files with both `.properties` and YAML format in the same location, `.properties` takes precedence.
|
||||
|
||||
NOTE: If you use environment variables rather than system properties, most operating systems disallow period-separated key names, but you can use underscores instead (for example, configprop:spring.config.name[format=envvar] instead of configprop:spring.config.name[]).
|
||||
See xref:features/external-config.adoc#features.external-config.typesafe-configuration-properties.relaxed-binding.environment-variables[Binding From Environment Variables] for details.
|
||||
See xref:features/external-config.adoc#features.external-config.typesafe-configuration-properties.relaxed-binding.environment-variables[] for details.
|
||||
|
||||
NOTE: If your application runs in a servlet container or application server, then JNDI properties (in `java:comp/env`) or servlet context initialization parameters can be used instead of, or as well as, environment variables or system properties.
|
||||
|
||||
@@ -54,7 +54,7 @@ For one-off testing, you can launch with a specific command line switch (for exa
|
||||
|
||||
TIP: The `env` and `configprops` endpoints can be useful in determining why a property has a particular value.
|
||||
You can use these two endpoints to diagnose unexpected property values.
|
||||
See the "xref:actuator/endpoints.adoc[Production ready features]" section for details.
|
||||
See the xref:actuator/endpoints.adoc[Production ready features] section for details.
|
||||
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ If you have a complex location setup, and you use profile-specific configuration
|
||||
A location group is a collection of locations that are all considered at the same level.
|
||||
For example, you might want to group all classpath locations, then all external locations.
|
||||
Items within a location group should be separated with `;`.
|
||||
See the example in the "`xref:features/external-config.adoc#features.external-config.files.profile-specific[Profile Specific Files]`" section for more details.
|
||||
See the example in the xref:features/external-config.adoc#features.external-config.files.profile-specific[] section for more details.
|
||||
|
||||
Locations configured by using `spring.config.location` replace the default locations.
|
||||
For example, if `spring.config.location` is configured with the value `optional:classpath:/custom-config/,optional:file:./custom-config/`, the complete set of locations considered is:
|
||||
@@ -325,7 +325,7 @@ The example above would import both `my.properties` as well as any `my-<profile>
|
||||
[TIP]
|
||||
====
|
||||
Spring Boot includes pluggable API that allows various different location addresses to be supported.
|
||||
By default you can import Java Properties, YAML and "`xref:features/external-config.adoc#features.external-config.files.configtree[configuration trees]`".
|
||||
By default you can import Java Properties, YAML and xref:features/external-config.adoc#features.external-config.files.configtree[configuration trees].
|
||||
|
||||
Third-party jars can offer support for additional technologies (there is no requirement for files to be local).
|
||||
For example, you can imagine config data being from external stores such as Consul, Apache ZooKeeper or Netflix Archaius.
|
||||
@@ -479,7 +479,7 @@ If you used `${demo.itemPrice}` instead, `demo.item-price` and `DEMO_ITEMPRICE`
|
||||
====
|
||||
|
||||
TIP: You can also use this technique to create "`short`" variants of existing Spring Boot properties.
|
||||
See the _xref:how-to:properties-and-configuration.adoc#howto.properties-and-configuration.short-command-line-arguments[Use '`Short`' Command Line Arguments]_ how-to for details.
|
||||
See the xref:how-to:properties-and-configuration.adoc#howto.properties-and-configuration.short-command-line-arguments[] section in "`How-to Guides`" for details.
|
||||
|
||||
|
||||
|
||||
@@ -573,7 +573,7 @@ myotherprop: "sometimes-set"
|
||||
|
||||
Spring Boot does not provide any built-in support for encrypting property values, however, it does provide the hook points necessary to modify values contained in the Spring `Environment`.
|
||||
The `EnvironmentPostProcessor` interface allows you to manipulate the `Environment` before the application starts.
|
||||
See xref:how-to:application.adoc#howto.application.customize-the-environment-or-application-context[Customize the Environment or ApplicationContext Before It Starts] for details.
|
||||
See xref:how-to:application.adoc#howto.application.customize-the-environment-or-application-context[] for details.
|
||||
|
||||
If you need a secure way to store credentials and passwords, the https://cloud.spring.io/spring-cloud-vault/[Spring Cloud Vault] project provides support for storing externalized configuration in https://www.vaultproject.io/[HashiCorp Vault].
|
||||
|
||||
@@ -637,7 +637,7 @@ my.servers[1]=another.example.com
|
||||
----
|
||||
|
||||
TIP: Properties that use the `[index]` notation can be bound to Java `List` or `Set` objects using Spring Boot's `Binder` class.
|
||||
For more details see the "`xref:features/external-config.adoc#features.external-config.typesafe-configuration-properties[Type-safe Configuration Properties]`" section below.
|
||||
For more details see the xref:features/external-config.adoc#features.external-config.typesafe-configuration-properties[] section below.
|
||||
|
||||
WARNING: YAML files cannot be loaded by using the `@PropertySource` or `@TestPropertySource` annotations.
|
||||
So, in the case that you need to load values that way, you need to use a properties file.
|
||||
@@ -892,8 +892,8 @@ NOTE: The `prefix` value for the annotation _must_ be in kebab case (lowercase a
|
||||
| Standard YAML list syntax or comma-separated values
|
||||
|
||||
| Environment Variables
|
||||
| Upper case format with underscore as the delimiter (see xref:features/external-config.adoc#features.external-config.typesafe-configuration-properties.relaxed-binding.environment-variables[Binding From Environment Variables]).
|
||||
| Numeric values surrounded by underscores (see xref:features/external-config.adoc#features.external-config.typesafe-configuration-properties.relaxed-binding.environment-variables[Binding From Environment Variables])
|
||||
| Upper case format with underscore as the delimiter (see xref:features/external-config.adoc#features.external-config.typesafe-configuration-properties.relaxed-binding.environment-variables[]).
|
||||
| Numeric values surrounded by underscores (see xref:features/external-config.adoc#features.external-config.typesafe-configuration-properties.relaxed-binding.environment-variables[])
|
||||
|
||||
| System properties
|
||||
| Camel case, kebab case, or underscore notation
|
||||
@@ -1190,7 +1190,7 @@ Doing so avoids any problems that may be caused by early instantiation.
|
||||
|
||||
TIP: The `spring-boot-actuator` module includes an endpoint that exposes all `@ConfigurationProperties` beans.
|
||||
Point your web browser to `/actuator/configprops` or use the equivalent JMX endpoint.
|
||||
See the "xref:actuator/endpoints.adoc[Production ready features]" section for details.
|
||||
See the xref:actuator/endpoints.adoc[Production ready features] section for details.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
|
||||
This section dives into the details of Spring Boot.
|
||||
Here you can learn about the key features that you may want to use and customize.
|
||||
If you have not already done so, you might want to read the "xref:tutorial:index.adoc[Tutorial]" and "xref:using/index.adoc[Developing with Spring Boot]" sections, so that you have a good grounding of the basics.
|
||||
If you have not already done so, you might want to read the xref:tutorial:index.adoc[] and xref:using/index.adoc[] sections, so that you have a good grounding of the basics.
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ All `@JsonComponent` beans in the `ApplicationContext` are automatically registe
|
||||
Because `@JsonComponent` is meta-annotated with `@Component`, the usual component-scanning rules apply.
|
||||
|
||||
Spring Boot also provides xref:api:java/org/springframework/boot/jackson/JsonObjectSerializer.html[`JsonObjectSerializer`] and xref:api:java/org/springframework/boot/jackson/JsonObjectDeserializer.html[`JsonObjectDeserializer`] base classes that provide useful alternatives to the standard Jackson versions when serializing objects.
|
||||
See xref:api:java/org/springframework/boot/jackson/JsonObjectSerializer.html[`JsonObjectSerializer`] and xref:api:java/org/springframework/boot/jackson/JsonObjectDeserializer.html[`JsonObjectDeserializer`] in the Javadoc for details.
|
||||
See xref:api:java/org/springframework/boot/jackson/JsonObjectSerializer.html[`JsonObjectSerializer`] and xref:api:java/org/springframework/boot/jackson/JsonObjectDeserializer.html[`JsonObjectDeserializer`] in the API documentation for details.
|
||||
|
||||
The example above can be rewritten to use `JsonObjectSerializer`/`JsonObjectDeserializer` as follows:
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ This means that you can specify active profiles in `application.properties` and
|
||||
Sometimes, it is useful to have properties that *add* to the active profiles rather than replace them.
|
||||
The `spring.profiles.include` property can be used to add active profiles on top of those activated by the configprop:spring.profiles.active[] property.
|
||||
The `SpringApplication` entry point also has a Java API for setting additional profiles.
|
||||
See the `setAdditionalProfiles()` method in xref:api:java/org/springframework/boot/SpringApplication.html[SpringApplication].
|
||||
See the `setAdditionalProfiles()` method in xref:api:java/org/springframework/boot/SpringApplication.html[`SpringApplication`].
|
||||
|
||||
For example, when an application with the following properties is run, the common and local profiles will be activated even when it runs using the `--spring.profiles.active` switch:
|
||||
|
||||
@@ -123,4 +123,4 @@ It is also possible to activate profiles by using Spring's `ConfigurableEnvironm
|
||||
== Profile-specific Configuration Files
|
||||
|
||||
Profile-specific variants of both `application.properties` (or `application.yaml`) and files referenced through `@ConfigurationProperties` are considered as files and loaded.
|
||||
See "xref:features/external-config.adoc#features.external-config.files.profile-specific[Profile Specific Files]" for details.
|
||||
See xref:features/external-config.adoc#features.external-config.files.profile-specific[] for details.
|
||||
|
||||
@@ -16,7 +16,7 @@ include::ROOT:partial$application/spring-application.txt[]
|
||||
|
||||
|
||||
By default, `INFO` logging messages are shown, including some relevant startup details, such as the user that launched the application.
|
||||
If you need a log level other than `INFO`, you can set it, as described in xref:features/logging.adoc#features.logging.log-levels[Log Levels].
|
||||
If you need a log level other than `INFO`, you can set it, as described in xref:features/logging.adoc#features.logging.log-levels[].
|
||||
The application version is determined using the implementation version from the main application class's package.
|
||||
Startup information logging can be turned off by setting `spring.main.log-startup-info` to `false`.
|
||||
This will also turn off logging of the application's active profiles.
|
||||
@@ -155,16 +155,16 @@ NOTE: The constructor arguments passed to `SpringApplication` are configuration
|
||||
In most cases, these are references to `@Configuration` classes, but they could also be direct references `@Component` classes.
|
||||
|
||||
It is also possible to configure the `SpringApplication` by using an `application.properties` file.
|
||||
See _xref:features/external-config.adoc[Externalized Configuration]_ for details.
|
||||
See xref:features/external-config.adoc[] for details.
|
||||
|
||||
For a complete list of the configuration options, see the xref:api:java/org/springframework/boot/SpringApplication.html[`SpringApplication` Javadoc].
|
||||
For a complete list of the configuration options, see the xref:api:java/org/springframework/boot/SpringApplication.html[`SpringApplication`] API documentation.
|
||||
|
||||
|
||||
|
||||
[[features.spring-application.fluent-builder-api]]
|
||||
== Fluent Builder API
|
||||
|
||||
If you need to build an `ApplicationContext` hierarchy (multiple contexts with a parent/child relationship) or if you prefer using a "`fluent`" builder API, you can use the `SpringApplicationBuilder`.
|
||||
If you need to build an `ApplicationContext` hierarchy (multiple contexts with a parent/child relationship) or if you prefer using a fluent builder API, you can use the `SpringApplicationBuilder`.
|
||||
|
||||
The `SpringApplicationBuilder` lets you chain together multiple method calls and includes `parent` and `child` methods that let you create a hierarchy, as shown in the following example:
|
||||
|
||||
@@ -172,7 +172,7 @@ include-code::MyApplication[tag=*]
|
||||
|
||||
NOTE: There are some restrictions when creating an `ApplicationContext` hierarchy.
|
||||
For example, Web components *must* be contained within the child context, and the same `Environment` is used for both parent and child contexts.
|
||||
See the xref:api:java/org/springframework/boot/builder/SpringApplicationBuilder.html[`SpringApplicationBuilder` Javadoc] for full details.
|
||||
See the xref:api:java/org/springframework/boot/builder/SpringApplicationBuilder.html[`SpringApplicationBuilder`] API documentation for full details.
|
||||
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ In addition, you can also obtain availability states by injecting the `Applicati
|
||||
The "`Liveness`" state of an application tells whether its internal state allows it to work correctly, or recover by itself if it is currently failing.
|
||||
A broken "`Liveness`" state means that the application is in a state that it cannot recover from, and the infrastructure should restart the application.
|
||||
|
||||
NOTE: In general, the "Liveness" state should not be based on external checks, such as xref:actuator/endpoints.adoc#actuator.endpoints.health[Health checks].
|
||||
NOTE: In general, the "Liveness" state should not be based on external checks, such as xref:actuator/endpoints.adoc#actuator.endpoints.health[health checks].
|
||||
If it did, a failing external system (a database, a Web API, an external cache) would trigger massive restarts and cascading failures across the platform.
|
||||
|
||||
The internal state of Spring Boot applications is mostly represented by the Spring `ApplicationContext`.
|
||||
|
||||
@@ -38,15 +38,15 @@ The cache abstraction does not provide an actual store and relies on abstraction
|
||||
|
||||
If you have not defined a bean of type `CacheManager` or a `CacheResolver` named `cacheResolver` (see {url-spring-framework-javadoc}/org/springframework/cache/annotation/CachingConfigurer.html[`CachingConfigurer`]), Spring Boot tries to detect the following providers (in the indicated order):
|
||||
|
||||
. xref:io/caching.adoc#io.caching.provider.generic[Generic]
|
||||
. xref:io/caching.adoc#io.caching.provider.jcache[JCache (JSR-107)] (EhCache 3, Hazelcast, Infinispan, and others)
|
||||
. xref:io/caching.adoc#io.caching.provider.hazelcast[Hazelcast]
|
||||
. xref:io/caching.adoc#io.caching.provider.infinispan[Infinispan]
|
||||
. xref:io/caching.adoc#io.caching.provider.couchbase[Couchbase]
|
||||
. xref:io/caching.adoc#io.caching.provider.redis[Redis]
|
||||
. xref:io/caching.adoc#io.caching.provider.caffeine[Caffeine]
|
||||
. xref:io/caching.adoc#io.caching.provider.cache2k[Cache2k]
|
||||
. xref:io/caching.adoc#io.caching.provider.simple[Simple]
|
||||
. xref:io/caching.adoc#io.caching.provider.generic[]
|
||||
. xref:io/caching.adoc#io.caching.provider.jcache[] (EhCache 3, Hazelcast, Infinispan, and others)
|
||||
. xref:io/caching.adoc#io.caching.provider.hazelcast[]
|
||||
. xref:io/caching.adoc#io.caching.provider.infinispan[]
|
||||
. xref:io/caching.adoc#io.caching.provider.couchbase[]
|
||||
. xref:io/caching.adoc#io.caching.provider.redis[]
|
||||
. xref:io/caching.adoc#io.caching.provider.caffeine[]
|
||||
. xref:io/caching.adoc#io.caching.provider.cache2k[]
|
||||
. xref:io/caching.adoc#io.caching.provider.simple[]
|
||||
|
||||
Additionally, {url-spring-boot-for-apache-geode-site}[Spring Boot for Apache Geode] provides {url-spring-boot-for-apache-geode-docs}#geode-caching-provider[auto-configuration for using Apache Geode as a cache provider].
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ The following component creates a listener endpoint on the `someQueue` destinati
|
||||
|
||||
include-code::MyBean[]
|
||||
|
||||
TIP: See {url-spring-framework-javadoc}/org/springframework/jms/annotation/EnableJms.html[the Javadoc of `@EnableJms`] for more details.
|
||||
TIP: See the {url-spring-framework-javadoc}/org/springframework/jms/annotation/EnableJms.html[`@EnableJms`] API documentation for more details.
|
||||
|
||||
If you need to create more `JmsListenerContainerFactory` instances or if you want to override the default, Spring Boot provides a `DefaultJmsListenerContainerFactoryConfigurer` that you can use to initialize a `DefaultJmsListenerContainerFactory` with the same settings as the one that is auto-configured.
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ The former can be configured using `spring.kafka.streams.application-id`, defaul
|
||||
The latter can be set globally or specifically overridden only for streams.
|
||||
|
||||
Several additional properties are available using dedicated properties; other arbitrary Kafka properties can be set using the `spring.kafka.streams.properties` namespace.
|
||||
See also xref:messaging/kafka.adoc#messaging.kafka.additional-properties[Additional Kafka Properties] for more information.
|
||||
See also xref:messaging/kafka.adoc#messaging.kafka.additional-properties[] for more information.
|
||||
|
||||
To use the factory bean, wire `StreamsBuilder` into your `@Bean` as shown in the following example:
|
||||
|
||||
@@ -79,7 +79,7 @@ You can customize this behavior using the configprop:spring.kafka.streams.auto-s
|
||||
[[messaging.kafka.additional-properties]]
|
||||
== Additional Kafka Properties
|
||||
|
||||
The properties supported by auto configuration are shown in the xref:appendix:application-properties/index.adoc#appendix.application-properties.integration["`Integration Properties`"] section of the Appendix.
|
||||
The properties supported by auto configuration are shown in the xref:appendix:application-properties/index.adoc#appendix.application-properties.integration[Integration Properties] section of the Appendix.
|
||||
Note that, for the most part, these properties (hyphenated or camelCase) map directly to the Apache Kafka dotted properties.
|
||||
See the Apache Kafka documentation for details.
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ You can also define a `PulsarAwareTransactionManager` bean if the default auto-c
|
||||
[[messaging.pulsar.additional-properties]]
|
||||
== Additional Pulsar Properties
|
||||
|
||||
The properties supported by auto-configuration are shown in the xref:appendix:application-properties/index.adoc#appendix.application-properties.integration["`Integration Properties`"] section of the Appendix.
|
||||
The properties supported by auto-configuration are shown in the xref:appendix:application-properties/index.adoc#appendix.application-properties.integration[Integration Properties] section of the Appendix.
|
||||
Note that, for the most part, these properties (hyphenated or camelCase) map directly to the Apache Pulsar configuration properties.
|
||||
See the Apache Pulsar documentation for details.
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ spring:
|
||||
initialize-schema: "always"
|
||||
----
|
||||
|
||||
If `spring-integration-rsocket` is available, developers can configure an RSocket server using `"spring.rsocket.server.*"` properties and let it use `IntegrationRSocketEndpoint` or `RSocketOutboundGateway` components to handle incoming RSocket messages.
|
||||
This infrastructure can handle Spring Integration RSocket channel adapters and `@MessageMapping` handlers (given `"spring.integration.rsocket.server.message-mapping-enabled"` is configured).
|
||||
If `spring-integration-rsocket` is available, developers can configure an RSocket server using `spring.rsocket.server.*` properties and let it use `IntegrationRSocketEndpoint` or `RSocketOutboundGateway` components to handle incoming RSocket messages.
|
||||
This infrastructure can handle Spring Integration RSocket channel adapters and `@MessageMapping` handlers (given `spring.integration.rsocket.server.message-mapping-enabled` is configured).
|
||||
|
||||
Spring Boot can also auto-configure an `ClientRSocketConnector` using configuration properties:
|
||||
|
||||
|
||||
@@ -32,4 +32,4 @@ It implies the following restrictions:
|
||||
- The Spring `@Profile` annotation and profile-specific configuration xref:how-to:aot.adoc#howto.aot.conditions[have limitations].
|
||||
- Properties that change if a bean is created are not supported (for example, `@ConditionalOnProperty` and `.enable` properties).
|
||||
|
||||
To learn more about ahead-of-time processing, please see the xref:packaging/native-image/introducing-graalvm-native-images.adoc#packaging.native-image.introducing-graalvm-native-images.understanding-aot-processing[Understanding Spring Ahead-of-Time Processing] section.
|
||||
To learn more about ahead-of-time processing, please see the xref:packaging/native-image/introducing-graalvm-native-images.adoc#packaging.native-image.introducing-graalvm-native-images.understanding-aot-processing[] section.
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
|
||||
Spring Boot supports several technologies for optimizing applications for deployment, including xref:packaging/native-image/index.adoc[GraalVM native images], xref:packaging/class-data-sharing.adoc[Class Data Sharing], and xref:packaging/checkpoint-restore.adoc[Checkpoint and Restore].
|
||||
|
||||
Spring Boot applications can be packaged in Docker containers using techniques described in xref:packaging/container-images/index.adoc[Container Images].
|
||||
Spring Boot applications can be packaged in Docker containers using techniques described in xref:packaging/container-images/index.adoc[].
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ This ahead-of-time processing involves statically analyzing your application cod
|
||||
A GraalVM Native Image is a complete, platform-specific executable.
|
||||
You do not need to ship a Java Virtual Machine in order to run a native image.
|
||||
|
||||
TIP: If you just want to get started and experiment with GraalVM you can jump to the xref:how-to:native-image/developing-your-first-application.adoc[Developing Your First GraalVM Native Application] section and return to this section later.
|
||||
TIP: If you just want to get started and experiment with GraalVM you can jump to the xref:how-to:native-image/developing-your-first-application.adoc[] section and return to this section later.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ You can then import the class explicitly where it is required, as shown in the f
|
||||
include-code::MyTests[]
|
||||
|
||||
NOTE: If you directly use `@ComponentScan` (that is, not through `@SpringBootApplication`) you need to register the `TypeExcludeFilter` with it.
|
||||
See xref:api:java/org/springframework/boot/context/TypeExcludeFilter.html[the Javadoc] for details.
|
||||
See the xref:api:java/org/springframework/boot/context/TypeExcludeFilter.html[`TypeExcludeFilter`] API documentation for details.
|
||||
|
||||
NOTE: An imported `@TestConfiguration` is processed earlier than an inner-class `@TestConfiguration` and an imported `@TestConfiguration` will be processed before any configuration found through component scanning.
|
||||
Generally speaking, this difference in ordering has no noticeable effect but it is something to be aware of if you're relying on bean overriding.
|
||||
@@ -263,7 +263,7 @@ By the time the test is executed, the application context refresh has completed
|
||||
We recommend using a `@Bean` method to create and configure the mock in this situation.
|
||||
|
||||
Additionally, you can use `@SpyBean` to wrap any existing bean with a Mockito `spy`.
|
||||
See the xref:api:java/org/springframework/boot/test/mock/mockito/SpyBean.html[Javadoc] for full details.
|
||||
See the xref:api:java/org/springframework/boot/test/mock/mockito/SpyBean.html[`SpyBean`] API documentation for full details.
|
||||
|
||||
NOTE: While Spring's test framework caches application contexts between tests and reuses a context for tests sharing the same configuration, the use of `@MockBean` or `@SpyBean` influences the cache key, which will most likely increase the number of contexts.
|
||||
|
||||
@@ -366,7 +366,7 @@ If you define your own `webDriver` scope you may find it stops working when you
|
||||
|
||||
If you have Spring Security on the classpath, `@WebMvcTest` will also scan `WebSecurityConfigurer` beans.
|
||||
Instead of disabling security completely for such tests, you can use Spring Security's test support.
|
||||
More details on how to use Spring Security's `MockMvc` support can be found in this _xref:how-to:testing.adoc#howto.testing.with-spring-security[Testing With Spring Security]_ how-to section.
|
||||
More details on how to use Spring Security's `MockMvc` support can be found in this xref:how-to:testing.adoc#howto.testing.with-spring-security[] "`How-to Guides`" section.
|
||||
|
||||
TIP: Sometimes writing Spring MVC tests is not enough; Spring Boot can help you run xref:testing/spring-boot-applications.adoc#testing.spring-boot-applications.with-running-server[full end-to-end tests with an actual server].
|
||||
|
||||
@@ -472,7 +472,7 @@ You can use `@DataCassandraTest` to test Cassandra applications.
|
||||
By default, it configures a `CassandraTemplate`, scans for `@Table` classes, and configures Spring Data Cassandra repositories.
|
||||
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataCassandraTest` annotation is used.
|
||||
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
|
||||
(For more about using Cassandra with Spring Boot, see "xref:data/nosql.adoc#data.nosql.cassandra[Cassandra]".)
|
||||
(For more about using Cassandra with Spring Boot, see xref:data/nosql.adoc#data.nosql.cassandra[].)
|
||||
|
||||
TIP: A list of the auto-configuration settings that are enabled by `@DataCassandraTest` can be xref:appendix:test-auto-configuration/index.adoc[found in the appendix].
|
||||
|
||||
@@ -489,7 +489,7 @@ You can use `@DataCouchbaseTest` to test Couchbase applications.
|
||||
By default, it configures a `CouchbaseTemplate` or `ReactiveCouchbaseTemplate`, scans for `@Document` classes, and configures Spring Data Couchbase repositories.
|
||||
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataCouchbaseTest` annotation is used.
|
||||
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
|
||||
(For more about using Couchbase with Spring Boot, see "xref:data/nosql.adoc#data.nosql.couchbase[Couchbase]", earlier in this chapter.)
|
||||
(For more about using Couchbase with Spring Boot, see xref:data/nosql.adoc#data.nosql.couchbase[], earlier in this chapter.)
|
||||
|
||||
TIP: A list of the auto-configuration settings that are enabled by `@DataCouchbaseTest` can be xref:appendix:test-auto-configuration/index.adoc[found in the appendix].
|
||||
|
||||
@@ -506,7 +506,7 @@ You can use `@DataElasticsearchTest` to test Elasticsearch applications.
|
||||
By default, it configures an `ElasticsearchRestTemplate`, scans for `@Document` classes, and configures Spring Data Elasticsearch repositories.
|
||||
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataElasticsearchTest` annotation is used.
|
||||
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
|
||||
(For more about using Elasticsearch with Spring Boot, see "xref:data/nosql.adoc#data.nosql.elasticsearch[Elasticsearch]", earlier in this chapter.)
|
||||
(For more about using Elasticsearch with Spring Boot, see xref:data/nosql.adoc#data.nosql.elasticsearch[], earlier in this chapter.)
|
||||
|
||||
TIP: A list of the auto-configuration settings that are enabled by `@DataElasticsearchTest` can be xref:appendix:test-auto-configuration/index.adoc[found in the appendix].
|
||||
|
||||
@@ -570,7 +570,7 @@ If that is not what you want, you can disable transaction management for a test
|
||||
include-code::MyTransactionalTests[]
|
||||
|
||||
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `@DataJpaTest`.
|
||||
(See "xref:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-spring-data-jpa[Auto-configured Data JPA Tests]".)
|
||||
(See xref:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-spring-data-jpa[].)
|
||||
|
||||
|
||||
|
||||
@@ -589,7 +589,7 @@ See the {url-spring-framework-docs}/testing/testcontext-framework/tx.html#testco
|
||||
If that is not what you want, you can disable transaction management for a test or for the whole test class as xref:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-jdbc[shown in the JDBC example].
|
||||
|
||||
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `@DataJpaTest`.
|
||||
(See "xref:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-spring-data-jpa[Auto-configured Data JPA Tests]".)
|
||||
(See xref:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-spring-data-jpa[].)
|
||||
|
||||
|
||||
|
||||
@@ -606,7 +606,7 @@ TIP: A list of the auto-configurations that are enabled by `@DataR2dbcTest` can
|
||||
By default, Data R2DBC tests are not transactional.
|
||||
|
||||
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `@DataJpaTest`.
|
||||
(See "xref:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-spring-data-jpa[Auto-configured Data JPA Tests]".)
|
||||
(See xref:testing/spring-boot-applications.adoc#testing.spring-boot-applications.autoconfigured-spring-data-jpa[].)
|
||||
|
||||
|
||||
|
||||
@@ -616,7 +616,7 @@ If you prefer your test to run against a real database, you can use the `@AutoCo
|
||||
You can use `@JooqTest` in a similar fashion as `@JdbcTest` but for jOOQ-related tests.
|
||||
As jOOQ relies heavily on a Java-based schema that corresponds with the database schema, the existing `DataSource` is used.
|
||||
If you want to replace it with an in-memory database, you can use `@AutoConfigureTestDatabase` to override those settings.
|
||||
(For more about using jOOQ with Spring Boot, see "xref:data/sql.adoc#data.sql.jooq[Using jOOQ]".)
|
||||
(For more about using jOOQ with Spring Boot, see xref:data/sql.adoc#data.sql.jooq[].)
|
||||
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@JooqTest` annotation is used.
|
||||
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
|
||||
|
||||
@@ -639,7 +639,7 @@ You can use `@DataMongoTest` to test MongoDB applications.
|
||||
By default, it configures a `MongoTemplate`, scans for `@Document` classes, and configures Spring Data MongoDB repositories.
|
||||
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataMongoTest` annotation is used.
|
||||
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
|
||||
(For more about using MongoDB with Spring Boot, see "xref:data/nosql.adoc#data.nosql.mongodb[MongoDB]".)
|
||||
(For more about using MongoDB with Spring Boot, see xref:data/nosql.adoc#data.nosql.mongodb[].)
|
||||
|
||||
TIP: A list of the auto-configuration settings that are enabled by `@DataMongoTest` can be xref:appendix:test-auto-configuration/index.adoc[found in the appendix].
|
||||
|
||||
@@ -656,7 +656,7 @@ You can use `@DataNeo4jTest` to test Neo4j applications.
|
||||
By default, it scans for `@Node` classes, and configures Spring Data Neo4j repositories.
|
||||
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataNeo4jTest` annotation is used.
|
||||
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
|
||||
(For more about using Neo4J with Spring Boot, see "xref:data/nosql.adoc#data.nosql.neo4j[Neo4j]".)
|
||||
(For more about using Neo4J with Spring Boot, see xref:data/nosql.adoc#data.nosql.neo4j[].)
|
||||
|
||||
TIP: A list of the auto-configuration settings that are enabled by `@DataNeo4jTest` can be xref:appendix:test-auto-configuration/index.adoc[found in the appendix].
|
||||
|
||||
@@ -682,7 +682,7 @@ You can use `@DataRedisTest` to test Redis applications.
|
||||
By default, it scans for `@RedisHash` classes and configures Spring Data Redis repositories.
|
||||
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataRedisTest` annotation is used.
|
||||
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
|
||||
(For more about using Redis with Spring Boot, see "xref:data/nosql.adoc#data.nosql.redis[Redis]".)
|
||||
(For more about using Redis with Spring Boot, see xref:data/nosql.adoc#data.nosql.redis[].)
|
||||
|
||||
TIP: A list of the auto-configuration settings that are enabled by `@DataRedisTest` can be xref:appendix:test-auto-configuration/index.adoc[found in the appendix].
|
||||
|
||||
@@ -699,7 +699,7 @@ You can use `@DataLdapTest` to test LDAP applications.
|
||||
By default, it configures an in-memory embedded LDAP (if available), configures an `LdapTemplate`, scans for `@Entry` classes, and configures Spring Data LDAP repositories.
|
||||
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataLdapTest` annotation is used.
|
||||
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
|
||||
(For more about using LDAP with Spring Boot, see "xref:data/nosql.adoc#data.nosql.ldap[LDAP]".)
|
||||
(For more about using LDAP with Spring Boot, see xref:data/nosql.adoc#data.nosql.ldap[].)
|
||||
|
||||
TIP: A list of the auto-configuration settings that are enabled by `@DataLdapTest` can be xref:appendix:test-auto-configuration/index.adoc[found in the appendix].
|
||||
|
||||
@@ -810,7 +810,7 @@ include-code::MyRestDocsConfiguration[]
|
||||
|
||||
You can use `@WebServiceClientTest` to test applications that call web services using the Spring Web Services project.
|
||||
By default, it configures a mock `WebServiceServer` bean and automatically customizes your `WebServiceTemplateBuilder`.
|
||||
(For more about using Web Services with Spring Boot, see "xref:io/webservices.adoc[Web Services]".)
|
||||
(For more about using Web Services with Spring Boot, see xref:io/webservices.adoc[].)
|
||||
|
||||
|
||||
TIP: A list of the auto-configuration settings that are enabled by `@WebServiceClientTest` can be xref:appendix:test-auto-configuration/index.adoc[found in the appendix].
|
||||
@@ -826,7 +826,7 @@ include-code::MyWebServiceClientTests[]
|
||||
|
||||
You can use `@WebServiceServerTest` to test applications that implement web services using the Spring Web Services project.
|
||||
By default, it configures a `MockWebServiceClient` bean that can be used to call your web service endpoints.
|
||||
(For more about using Web Services with Spring Boot, see "xref:io/webservices.adoc[Web Services]".)
|
||||
(For more about using Web Services with Spring Boot, see xref:io/webservices.adoc[].)
|
||||
|
||||
|
||||
TIP: A list of the auto-configuration settings that are enabled by `@WebServiceServerTest` can be xref:appendix:test-auto-configuration/index.adoc[found in the appendix].
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using.build-systems]]
|
||||
= Build Systems
|
||||
|
||||
It is strongly recommended that you choose a build system that supports xref:using/build-systems.adoc#using.build-systems.dependency-management[_dependency management_] and that can consume artifacts published to the "`Maven Central`" repository.
|
||||
It is strongly recommended that you choose a build system that supports xref:using/build-systems.adoc#using.build-systems.dependency-management[dependency management] and that can consume artifacts published to the Maven Central repository.
|
||||
We would recommend that you choose Maven or Gradle.
|
||||
It is possible to get Spring Boot to work with other build systems (Ant, for example), but they are not particularly well supported.
|
||||
|
||||
@@ -106,7 +106,7 @@ A typical `build.xml` looks like the following example:
|
||||
</project>
|
||||
----
|
||||
|
||||
TIP: If you do not want to use the `spring-boot-antlib` module, see the _xref:how-to:build.adoc#howto.build.build-an-executable-archive-with-ant-without-using-spring-boot-antlib[Build an Executable Archive From Ant without Using spring-boot-antlib]_ "`How-to`" .
|
||||
TIP: If you do not want to use the `spring-boot-antlib` module, see the xref:how-to:build.adoc#howto.build.build-an-executable-archive-with-ant-without-using-spring-boot-antlib[] section of "`How-to Guides`".
|
||||
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ This naming structure is intended to help when you need to find a starter.
|
||||
The Maven integration in many IDEs lets you search dependencies by name.
|
||||
For example, with the appropriate Eclipse or Spring Tools plugin installed, you can press `ctrl-space` in the POM editor and type "`spring-boot-starter`" for a complete list.
|
||||
|
||||
As explained in the "`xref:features/developing-auto-configuration.adoc#features.developing-auto-configuration.custom-starter[Creating Your Own Starter]`" section, third party starters should not start with `spring-boot`, as it is reserved for official Spring Boot artifacts.
|
||||
As explained in the xref:features/developing-auto-configuration.adoc#features.developing-auto-configuration.custom-starter[] section, third party starters should not start with `spring-boot`, as it is reserved for official Spring Boot artifacts.
|
||||
Rather, a third-party starter typically starts with the name of the project.
|
||||
For example, a third-party starter project called `thirdpartyproject` would typically be named `thirdpartyproject-spring-boot-starter`.
|
||||
****
|
||||
@@ -136,7 +136,7 @@ The following application starters are provided by Spring Boot under the `org.sp
|
||||
.Spring Boot application starters
|
||||
include::ROOT:partial$starters/application-starters.adoc[]
|
||||
|
||||
In addition to the application starters, the following starters can be used to add _xref:how-to:actuator.adoc[production ready]_ features:
|
||||
In addition to the application starters, the following starters can be used to add xref:how-to:actuator.adoc[production ready] features:
|
||||
|
||||
.Spring Boot production starters
|
||||
include::ROOT:partial$starters/production-starters.adoc[]
|
||||
|
||||
@@ -26,7 +26,7 @@ dependencies {
|
||||
----
|
||||
|
||||
CAUTION: Devtools might cause classloading issues, in particular in multi-module projects.
|
||||
xref:using/devtools.adoc#using.devtools.diagnosing-classloading-issues[Diagnosing Classloading Issues] explains how to diagnose and solve them.
|
||||
xref:using/devtools.adoc#using.devtools.diagnosing-classloading-issues[] explains how to diagnose and solve them.
|
||||
|
||||
NOTE: Developer tools are automatically disabled when running a fully packaged application.
|
||||
If your application is launched from `java -jar` or if it is started from a special classloader, then it is considered a "`production application`".
|
||||
@@ -105,7 +105,7 @@ NOTE: If you are restarting with Maven or Gradle using the build plugin you must
|
||||
If you disable forking, the isolated application classloader used by devtools will not be created and restarts will not operate properly.
|
||||
|
||||
TIP: Automatic restart works very well when used with LiveReload.
|
||||
xref:using/devtools.adoc#using.devtools.livereload[See the LiveReload section] for details.
|
||||
See the xref:using/devtools.adoc#using.devtools.livereload[] section for details.
|
||||
If you use JRebel, automatic restarts are disabled in favor of dynamic class reloading.
|
||||
Other devtools features (such as LiveReload and property overrides) can still be used.
|
||||
|
||||
@@ -293,7 +293,7 @@ NOTE: You can only run one LiveReload server at a time.
|
||||
Before starting your application, ensure that no other LiveReload servers are running.
|
||||
If you start multiple applications from your IDE, only the first has LiveReload support.
|
||||
|
||||
WARNING: To trigger LiveReload when a file changes, xref:using/devtools.adoc#using.devtools.restart[Automatic Restart] must be enabled.
|
||||
WARNING: To trigger LiveReload when a file changes, xref:using/devtools.adoc#using.devtools.restart[] must be enabled.
|
||||
|
||||
|
||||
|
||||
@@ -437,7 +437,7 @@ The next batch can’t be sent to the application, since the server is restartin
|
||||
This is typically manifested by a warning in the `RemoteSpringApplication` logs about failing to upload some of the classes, and a consequent retry.
|
||||
But it may also lead to application code inconsistency and failure to restart after the first batch of changes is uploaded.
|
||||
If you observe such problems constantly, try increasing the `spring.devtools.restart.poll-interval` and `spring.devtools.restart.quiet-period` parameters to the values that fit your development environment.
|
||||
See the xref:using/devtools.adoc#using.devtools.globalsettings.configuring-file-system-watcher[Configuring File System Watcher] section for configuring these properties.
|
||||
See the xref:using/devtools.adoc#using.devtools.globalsettings.configuring-file-system-watcher[] section for configuring these properties.
|
||||
|
||||
NOTE: Files are only monitored when the remote client is running.
|
||||
If you change a file before starting the remote client, it is not pushed to the remote server.
|
||||
|
||||
@@ -6,5 +6,5 @@ It covers topics such as build systems, auto-configuration, and how to run your
|
||||
We also cover some Spring Boot best practices.
|
||||
Although there is nothing particularly special about Spring Boot (it is just another library that you can consume), there are a few recommendations that, when followed, make your development process a little easier.
|
||||
|
||||
If you are starting out with Spring Boot, you should probably read the xref:tutorial:first-application/index.adoc[_Developing your first Spring Boot application_] tutorial before diving into this section.
|
||||
If you are starting out with Spring Boot, you should probably read the xref:tutorial:first-application/index.adoc[] tutorial before diving into this section.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
Once your Spring Boot application is ready for production deployment, there are many options for packaging and optimizing
|
||||
the application.
|
||||
See the xref:packaging/index.adoc[Packaging] section of the documentation to read about these features.
|
||||
See the xref:packaging/index.adoc[] section of the documentation to read about these features.
|
||||
|
||||
For additional "production ready" features, such as health, auditing, and metric REST or JMX end-points, consider adding `spring-boot-actuator`.
|
||||
See xref:how-to:actuator.adoc[Actuator] for details.
|
||||
See xref:how-to:actuator.adoc[] for details.
|
||||
|
||||
@@ -6,7 +6,7 @@ The sample applies to debugging Spring Boot applications.
|
||||
You do not need any special IDE plugins or extensions.
|
||||
|
||||
NOTE: The options below are best suited for running an application locally for development.
|
||||
For production deployment, see xref:reference:using/packaging-for-production.adoc[Packaging for Production].
|
||||
For production deployment, see xref:reference:using/packaging-for-production.adoc[].
|
||||
|
||||
NOTE: This section only covers jar-based packaging.
|
||||
If you choose to package your application as a war file, see your server and IDE documentation.
|
||||
@@ -101,4 +101,4 @@ JVM hot swapping is somewhat limited with the bytecode that it can replace.
|
||||
For a more complete solution, https://www.jrebel.com/products/jrebel[JRebel] can be used.
|
||||
|
||||
The `spring-boot-devtools` module also includes support for quick application restarts.
|
||||
See the xref:how-to:hotswapping.adoc[Hot swapping "`How-to`"] for details.
|
||||
See the xref:how-to:hotswapping.adoc[] section in "`How-to Guides`" for details.
|
||||
|
||||
@@ -9,7 +9,7 @@ The exact way in which new requests are not permitted varies depending on the we
|
||||
Implementations may stop accepting requests at the network layer, or they may return a response with a specific HTTP status code or HTTP header.
|
||||
The use of persistent connections can also change the way that requests stop being accepted.
|
||||
|
||||
TIP: To learn about more the specific method used with your web server, see the `shutDownGracefully` javadoc for xref:api:java/org/springframework/boot/web/embedded/tomcat/TomcatWebServer.html#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[TomcatWebServer], xref:api:java/org/springframework/boot/web/embedded/netty/NettyWebServer.html#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[NettyWebServer], xref:api:java/org/springframework/boot/web/embedded/jetty/JettyWebServer.html#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[JettyWebServer] or xref:api:java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.html#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[UndertowWebServer].
|
||||
TIP: To learn about more the specific method used with your web server, see the `shutDownGracefully` API documentation for xref:api:java/org/springframework/boot/web/embedded/tomcat/TomcatWebServer.html#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[`TomcatWebServer`], xref:api:java/org/springframework/boot/web/embedded/netty/NettyWebServer.html#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[`NettyWebServer`], xref:api:java/org/springframework/boot/web/embedded/jetty/JettyWebServer.html#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[`JettyWebServer`] or xref:api:java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.html#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[`UndertowWebServer`].
|
||||
|
||||
Jetty, Reactor Netty, and Tomcat will stop accepting new requests at the network layer.
|
||||
Undertow will accept new connections but respond immediately with a service unavailable (503) response.
|
||||
|
||||
@@ -6,4 +6,4 @@ You can create a self-contained HTTP server by using embedded Tomcat, Jetty, Und
|
||||
Most web applications use the `spring-boot-starter-web` module to get up and running quickly.
|
||||
You can also choose to build reactive web applications by using the `spring-boot-starter-webflux` module.
|
||||
|
||||
If you have not yet developed a Spring Boot web application, you can follow the "Hello World!" example in the _xref:tutorial:first-application/index.adoc[Getting started]_ section.
|
||||
If you have not yet developed a Spring Boot web application, you can follow the "`Hello World!`" example in the xref:tutorial:first-application/index.adoc[Getting started] section.
|
||||
|
||||
@@ -321,7 +321,7 @@ For more advanced use cases that require you to extend from `ReactiveWebServerFa
|
||||
|
||||
Setters are provided for many configuration options.
|
||||
Several protected method "`hooks`" are also provided should you need to do something more exotic.
|
||||
See the xref:api:java/org/springframework/boot/web/reactive/server/ConfigurableReactiveWebServerFactory.html[source code documentation] for details.
|
||||
See the xref:api:java/org/springframework/boot/web/reactive/server/ConfigurableReactiveWebServerFactory.html[`ConfigurableReactiveWebServerFactory`] API documentation for details.
|
||||
|
||||
NOTE: Auto-configured customizers are still applied on your custom factory, so use that option carefully.
|
||||
|
||||
@@ -339,6 +339,6 @@ By default, those resources will be also shared with the Reactor Netty and Jetty
|
||||
|
||||
Developers can override the resource configuration for Jetty and Reactor Netty by providing a custom `ReactorResourceFactory` or `JettyResourceFactory` bean - this will be applied to both clients and servers.
|
||||
|
||||
You can learn more about the resource configuration on the client side in the xref:io/rest-client.adoc#io.rest-client.webclient.runtime[WebClient Runtime section].
|
||||
You can learn more about the resource configuration on the client side in the xref:io/rest-client.adoc#io.rest-client.webclient.runtime[] section.
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ The custom instances will be subject to further initialization and configuration
|
||||
To participate in, and if desired, override that subsequent processing, a `WebMvcConfigurer` should be used.
|
||||
|
||||
If you do not want to use the auto-configuration and want to take complete control of Spring MVC, add your own `@Configuration` annotated with `@EnableWebMvc`.
|
||||
Alternatively, add your own `@Configuration`-annotated `DelegatingWebMvcConfiguration` as described in the Javadoc of `@EnableWebMvc`.
|
||||
Alternatively, add your own `@Configuration`-annotated `DelegatingWebMvcConfiguration` as described in the `@EnableWebMvc` API documentation.
|
||||
|
||||
|
||||
|
||||
@@ -342,7 +342,7 @@ For machine clients, it produces a JSON response with details of the error, the
|
||||
For browser clients, there is a "`whitelabel`" error view that renders the same data in HTML format (to customize it, add a `View` that resolves to `error`).
|
||||
|
||||
There are a number of `server.error` properties that can be set if you want to customize the default error handling behavior.
|
||||
See the xref:appendix:application-properties/index.adoc#appendix.application-properties.server["`Server Properties`"] section of the Appendix.
|
||||
See the xref:appendix:application-properties/index.adoc#appendix.application-properties.server[Server Properties] section of the Appendix.
|
||||
|
||||
To replace the default behavior completely, you can implement `ErrorController` and register a bean definition of that type or add a bean of type `ErrorAttributes` to use the existing mechanism but replace the contents.
|
||||
|
||||
@@ -684,7 +684,7 @@ For more advanced use cases that require you to extend from `ServletWebServerFac
|
||||
|
||||
Setters are provided for many configuration options.
|
||||
Several protected method "`hooks`" are also provided should you need to do something more exotic.
|
||||
See the xref:api:java/org/springframework/boot/web/servlet/server/ConfigurableServletWebServerFactory.html[source code documentation] for details.
|
||||
See the xref:api:java/org/springframework/boot/web/servlet/server/ConfigurableServletWebServerFactory.html[`ConfigurableServletWebServerFactory`] API documentation for details.
|
||||
|
||||
NOTE: Auto-configured customizers are still applied on your custom factory, so use that option carefully.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user