@ -14,7 +14,7 @@ However, it is possible to <<configuration-metadata-additional-metadata,write pa
[[configuration-metadata-format]]
[[configuration-metadata-format]]
== Metadata Format
== Metadata Format
Configuration metadata files are located inside jars under `META-INF/spring-configuration-metadata.json`.
Configuration metadata files are located inside jars under `META-INF/spring-configuration-metadata.json`.
They use a simple JSON format with items categorized under either "`groups`" or "`properties`" and additional values hints categorized under "hints", as shown in the following example:
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]
[source,json,indent=0]
----
----
@ -762,7 +762,7 @@ This dependency ensures that the additional metadata is available when the annot
The processor picks up both classes and methods that are annotated with `@ConfigurationProperties`.
The processor picks up both classes and methods that are annotated with `@ConfigurationProperties`.
The Javadoc for field values within configuration classes is used to populate the `description` attribute.
The Javadoc for field values within configuration classes is used to populate the `description` attribute.
NOTE: You should only use simple text with `@ConfigurationProperties` field Javadoc, since they are not processed before being added to the JSON.
NOTE: You should only use plain text with `@ConfigurationProperties` field Javadoc, since they are not processed before being added to the JSON.
If the class has a single constructor with at least one parameters, one property is created per constructor parameter.
If the class has a single constructor with at least one parameters, one property is created per constructor parameter.
Otherwise, properties are discovered through the presence of standard getters and setters with special handling for collection types (that is detected even if only a getter is present).
Otherwise, properties are discovered through the presence of standard getters and setters with special handling for collection types (that is detected even if only a getter is present).
@ -14,7 +14,7 @@ This section covers some of the more common deployment scenarios.
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.
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.
Certain PaaS implementations may also choose to unpack archives before they run.
For example, Cloud Foundry operates this way.
For example, Cloud Foundry operates this way.
The simplest way to run an unpacked archive is by starting the appropriate launcher, as follows:
One way to run an unpacked archive is by starting the appropriate launcher, as follows:
[indent=0]
[indent=0]
----
----
@ -55,7 +55,7 @@ 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.
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 <<getting-started.adoc#getting-started-first-application, simple application that we developed>> in the "`Getting Started`" section up and running in the Cloud.
In this section, we look at what it takes to get the <<getting-started.adoc#getting-started-first-application, application that we developed>> in the "`Getting Started`" section up and running in the Cloud.
@ -286,7 +286,7 @@ The options include:
* AWS Container Registry
* AWS Container Registry
Each has different features and pricing models.
Each has different features and pricing models.
In this document, we describe only the simplest option: AWS Elastic Beanstalk.
In this document, we describe to approach using AWS Elastic Beanstalk.
@ -458,7 +458,7 @@ Then deploy with `mvn appengine:deploy` (if you need to authenticate first, the
== Installing Spring Boot Applications
== 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.
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 <<deployment-service,registered with `init.d` or `systemd`>>.
A fully executable jar can be executed like any other executable binary or it can be <<deployment-service,registered with `init.d` or `systemd`>>.
This makes it very easy to install and manage Spring Boot applications in common production environments.
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.
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.
Currently, some tools do not accept this format, so you may not always be able to use this technique.
@ -808,7 +808,7 @@ The following environment properties are supported with the default script:
| The explicit location of the jar file, in case the script is being used to launch a jar that it is not actually embedded.
| 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`
| `DEBUG`
| If not empty, sets the `-x` flag on the shell process, making it easy to see the logic in the script.
| If not empty, sets the `-x` flag on the shell process, allowing you to see the logic in the script.
| `STOP_WAIT_TIME`
| `STOP_WAIT_TIME`
| The time in seconds to wait when stopping the application before forcing a shutdown (`60` by default).
| The time in seconds to wait when stopping the application before forcing a shutdown (`60` by default).
NOTE: If you need access to the `BeanFactory` or the `Environment`, your `FailureAnalyzer` can simply implement `BeanFactoryAware` or `EnvironmentAware` respectively.
NOTE: If you need access to the `BeanFactory` or the `Environment`, your `FailureAnalyzer` can implement `BeanFactoryAware` or `EnvironmentAware` respectively.
@ -415,7 +415,7 @@ Many Spring Boot starters include default embedded containers.
* For reactive stack applications, the `spring-boot-starter-webflux` includes Reactor Netty by including `spring-boot-starter-reactor-netty`, but you can use `spring-boot-starter-tomcat`, `spring-boot-starter-jetty`, or `spring-boot-starter-undertow` instead.
* For reactive stack applications, the `spring-boot-starter-webflux` includes Reactor Netty by including `spring-boot-starter-reactor-netty`, but you can use `spring-boot-starter-tomcat`, `spring-boot-starter-jetty`, or `spring-boot-starter-undertow` instead.
When switching to a different HTTP server, you need to exclude the default dependencies in addition to including the one you need.
When switching to a different HTTP server, you need to exclude the default dependencies in addition to including the one you need.
Spring Boot provides separate starters for HTTP servers to help make this process as easy as possible.
To help with this process, Spring Boot provides a separate starter for each of the supported HTTP servers.
The following Maven example shows how to exclude Tomcat and include Jetty for Spring MVC:
The following Maven example shows how to exclude Tomcat and include Jetty for Spring MVC:
@ -1026,7 +1026,7 @@ The `ObjectMapper` (or `XmlMapper` for Jackson XML converter) instance (created
Spring Boot also has some features to make it easier to customize this behavior.
Spring Boot also has some features to make it easier to customize this behavior.
You can configure the `ObjectMapper` and `XmlMapper` instances by using the environment.
You can configure the `ObjectMapper` and `XmlMapper` instances by using the environment.
Jackson provides an extensive suite of simple on/off features that can be used to configure various aspects of its processing.
Jackson provides an extensive suite of on/off features that can be used to configure various aspects of its processing.
These features are described in six enums (in Jackson) that map onto properties in the environment:
These features are described in six enums (in Jackson) that map onto properties in the environment:
|===
|===
@ -1287,7 +1287,7 @@ This ensures efficient sharing of resources for the server receiving requests an
== Logging
== Logging
Spring Boot has no mandatory logging dependency, except for the Commons Logging API, which is typically provided by Spring Framework's `spring-jcl` module.
Spring Boot has no mandatory logging dependency, except for the Commons Logging API, which is typically provided by Spring Framework's `spring-jcl` module.
To use https://logback.qos.ch[Logback], you need to include it and `spring-jcl` on the classpath.
To use https://logback.qos.ch[Logback], you need to include it and `spring-jcl` on the classpath.
The simplest way to do that is through the starters, which all depend on `spring-boot-starter-logging`.
The recommended way to do that is through the starters, which all depend on `spring-boot-starter-logging`.
For a web application, you need only `spring-boot-starter-web`, since it depends transitively on the logging starter.
For a web application, you need only `spring-boot-starter-web`, since it depends transitively on the logging starter.
If you use Maven, the following dependency adds logging for you:
If you use Maven, the following dependency adds logging for you:
@ -1402,7 +1402,7 @@ Spring Boot supports https://logging.apache.org/log4j/2.x/[Log4j 2] for logging
If you use the starters for assembling dependencies, you have to exclude Logback and then include log4j 2 instead.
If you use the starters for assembling dependencies, you have to exclude Logback and then include log4j 2 instead.
If you do not use the starters, you need to provide (at least) `spring-jcl` in addition to Log4j 2.
If you do not use the starters, you need to provide (at least) `spring-jcl` in addition to Log4j 2.
The simplest path is probably through the starters, even though it requires some jiggling with excludes.
The recommended path is through the starters, even though it requires some jiggling with excludes.
The following example shows how to set up the starters in Maven:
The following example shows how to set up the starters in Maven:
@ -1736,8 +1736,7 @@ See {spring-boot-autoconfigure-module-code}/orm/jpa/HibernateJpaAutoConfiguratio
Hibernate {hibernate-docs}#caching[second-level cache] can be configured for a range of cache providers.
Hibernate {hibernate-docs}#caching[second-level cache] can be configured for a range of cache providers.
Rather than configuring Hibernate to lookup the cache provider again, it is better to provide the one that is available in the context whenever possible.
Rather than configuring Hibernate to lookup the cache provider again, it is better to provide the one that is available in the context whenever possible.
If you're using JCache, this is pretty easy.
To do this with JCache, first make sure that `org.hibernate:hibernate-jcache` is available on the classpath.
First, make sure that `org.hibernate:hibernate-jcache` is available on the classpath.
Then, add a `HibernatePropertiesCustomizer` bean as shown in the following example:
Then, add a `HibernatePropertiesCustomizer` bean as shown in the following example:
[source,java,indent=0]
[source,java,indent=0]
@ -1768,10 +1767,9 @@ Spring Boot auto-configuration switches off its entity manager in the presence o
[[howto-use-two-entity-managers]]
[[howto-use-two-entity-managers]]
=== Use Two EntityManagers
=== Use Two EntityManagers
Even if the default `EntityManagerFactory` works fine, you need to define a new one.
Even if the default `EntityManagerFactory` works fine, you need to define a new one, otherwise the presence of the second bean of that type switches off the default.
Otherwise, the presence of the second bean of that type switches off the default.
You can use the `EntityManagerBuilder` provided by Spring Boot to help you to create one.
To make it easy to do, you can use the convenient `EntityManagerBuilder` provided by Spring Boot.
Alternatively, you can use the `LocalContainerEntityManagerFactoryBean` directly from Spring ORM, as shown in the following example:
Alternatively, you can just the `LocalContainerEntityManagerFactoryBean` directly from Spring ORM, as shown in the following example:
@ -1978,7 +1976,7 @@ You can tune that behavior by setting `spring.datasource.continue-on-error`.
=== Initialize a Database Using R2DBC
=== Initialize a Database Using R2DBC
If you are using R2DBC, the regular `DataSource` auto-configuration backs off so none of the options described above can be used.
If you are using R2DBC, the regular `DataSource` auto-configuration backs off so none of the options described above can be used.
If you are using Spring Data R2DBC, you can initialize the database on startup using simple SQL scripts as shown in the following example:
If you are using Spring Data R2DBC, you can initialize the database on startup using SQL scripts as shown in the following example:
[source,java,indent=0]
[source,java,indent=0]
----
----
@ -2224,7 +2222,7 @@ Overriding the error page with your own depends on the templating technology tha
For example, if you use Thymeleaf, you can add an `error.html` template.
For example, if you use Thymeleaf, you can add an `error.html` template.
If you use FreeMarker, you can add an `error.ftlh` template.
If you use FreeMarker, you can add an `error.ftlh` template.
In general, you need a `View` that resolves with a name of `error` or a `@Controller` that handles the `/error` path.
In general, you need a `View` that resolves with a name of `error` or a `@Controller` that handles the `/error` path.
Unless you replaced some of the default configuration, you should find a `BeanNameViewResolver` in your `ApplicationContext`, so a `@Bean` named `error` would be a simple way of doing that.
Unless you replaced some of the default configuration, you should find a `BeanNameViewResolver` in your `ApplicationContext`, so a `@Bean` named `error` would be one way of doing that.
See {spring-boot-autoconfigure-module-code}/web/servlet/error/ErrorMvcAutoConfiguration.java[`ErrorMvcAutoConfiguration`] for more options.
See {spring-boot-autoconfigure-module-code}/web/servlet/error/ErrorMvcAutoConfiguration.java[`ErrorMvcAutoConfiguration`] for more options.
See also the section on "`<<spring-boot-features.adoc#boot-features-error-handling, Error Handling>>`" for details of how to register handlers in the servlet container.
See also the section on "`<<spring-boot-features.adoc#boot-features-error-handling, Error Handling>>`" for details of how to register handlers in the servlet container.
@ -2773,8 +2771,7 @@ This means that, in addition to being deployable to a servlet container, you can
=== Convert an Existing Application to Spring Boot
=== Convert an Existing Application to Spring Boot
For a non-web application, it should be easy to convert an existing Spring application to a Spring Boot application.
To convert an existing non-web Spring application to a Spring Boot application, replace the code that creates your `ApplicationContext` and replace it with calls to `SpringApplication` or `SpringApplicationBuilder`.
To do so, throw away the code that creates your `ApplicationContext` and replace it with calls to `SpringApplication` or `SpringApplicationBuilder`.
Spring MVC web applications are generally amenable to first creating a deployable war application and then migrating it later to an executable war or jar.
Spring MVC web applications are generally amenable to first creating a deployable war application and then migrating it later to an executable war or jar.
See the https://spring.io/guides/gs/convert-jar-to-war/[Getting Started Guide on Converting a jar to a war].
See the https://spring.io/guides/gs/convert-jar-to-war/[Getting Started Guide on Converting a jar to a war].
@ -2809,7 +2806,7 @@ If you have other features in your application (for instance, using other servle
* A `@Bean` of type `Servlet` or `ServletRegistrationBean` installs that bean in the container as if it were a `<servlet/>` and `<servlet-mapping/>` in `web.xml`.
* A `@Bean` of type `Servlet` or `ServletRegistrationBean` installs that bean in the container as if it were a `<servlet/>` and `<servlet-mapping/>` in `web.xml`.
* A `@Bean` of type `Filter` or `FilterRegistrationBean` behaves similarly (as a `<filter/>` and `<filter-mapping/>`).
* A `@Bean` of type `Filter` or `FilterRegistrationBean` behaves similarly (as a `<filter/>` and `<filter-mapping/>`).
* An `ApplicationContext` in an XML file can be added through an `@ImportResource` in your `Application`.
* An `ApplicationContext` in an XML file can be added through an `@ImportResource` in your `Application`.
Alternatively, simple cases where annotation configuration is heavily used already can be recreated in a few lines as `@Bean` definitions.
Alternatively, cases where annotation configuration is heavily used already can be recreated in a few lines as `@Bean` definitions.
Once the war file is working, you can make it executable by adding a `main` method to your `Application`, as shown in the following example:
Once the war file is working, you can make it executable by adding a `main` method to your `Application`, as shown in the following example:
@ -2913,7 +2910,7 @@ You can do so by adding a `WEB-INF/weblogic.xml` file with the following content
=== Use Jedis Instead of Lettuce
=== Use Jedis Instead of Lettuce
By default, the Spring Boot starter (`spring-boot-starter-data-redis`) uses https://github.com/lettuce-io/lettuce-core/[Lettuce].
By default, the Spring Boot starter (`spring-boot-starter-data-redis`) uses https://github.com/lettuce-io/lettuce-core/[Lettuce].
You need to exclude that dependency and include the https://github.com/xetorthio/jedis/[Jedis] one instead.
You need to exclude that dependency and include the https://github.com/xetorthio/jedis/[Jedis] one instead.
Spring Boot manages these dependencies to help make this process as easy as possible.
Spring Boot manages both of these dependencies so you can switch to Jedis without specifying a version.
The following example shows how to do so in Maven:
The following example shows how to do so in Maven:
@ -11,7 +11,7 @@ Auditing, health, and metrics gathering can also be automatically applied to you
[[production-ready-enabling]]
[[production-ready-enabling]]
== Enabling Production-ready Features
== 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 {spring-boot-code}/spring-boot-project/spring-boot-actuator[`spring-boot-actuator`] module provides all of Spring Boot's production-ready features.
The simplest way to enable the features is to add a dependency to the `spring-boot-starter-actuator` '`Starter`'.
The recommended way to enable the features is to add a dependency on the `spring-boot-starter-actuator` '`Starter`'.
.Definition of Actuator
.Definition of Actuator
****
****
@ -2178,7 +2178,7 @@ You can also add any number of `tag=KEY:VALUE` query parameters to the end of th
====
====
The reported measurements are the _sum_ of the statistics of all meters matching the meter name and any tags that have been applied.
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.
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 just 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`.
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`.
@ -338,7 +338,7 @@ The context can be injected by implementing `ApplicationContextAware` or, if the
[[boot-features-web-environment]]
[[boot-features-web-environment]]
=== Web Environment
=== Web Environment
A `SpringApplication` attempts to create the right type of `ApplicationContext` on your behalf.
A `SpringApplication` attempts to create the right type of `ApplicationContext` on your behalf.
The algorithm used to determine a `WebApplicationType` is fairly simple:
The algorithm used to determine a `WebApplicationType` is the following:
* If Spring MVC is present, an `AnnotationConfigServletWebServerApplicationContext` is used
* If Spring MVC is present, an `AnnotationConfigServletWebServerApplicationContext` is used
* If Spring MVC is not present and Spring WebFlux is present, an `AnnotationConfigReactiveWebServerApplicationContext` is used
* If Spring MVC is not present and Spring WebFlux is present, an `AnnotationConfigReactiveWebServerApplicationContext` is used
@ -387,7 +387,7 @@ This lets you also inject single application arguments by using the `@Value` ann
If you need to run some specific code once the `SpringApplication` has started, you can implement the `ApplicationRunner` or `CommandLineRunner` interfaces.
If you need to run some specific code once the `SpringApplication` has started, you can implement the `ApplicationRunner` or `CommandLineRunner` interfaces.
Both interfaces work in the same way and offer a single `run` method, which is called just before `SpringApplication.run(...)` completes.
Both interfaces work in the same way and offer a single `run` method, which is called just before `SpringApplication.run(...)` completes.
The `CommandLineRunner` interfaces provides access to application arguments as a simple string array, whereas the `ApplicationRunner` uses the `ApplicationArguments` interface discussed earlier.
The `CommandLineRunner` interfaces provides access to application arguments as a string array, whereas the `ApplicationRunner` uses the `ApplicationArguments` interface discussed earlier.
The following example shows a `CommandLineRunner` with a `run` method:
The following example shows a `CommandLineRunner` with a `run` method:
[source,java,indent=0]
[source,java,indent=0]
@ -785,7 +785,7 @@ If the `development`, `production` and `eu-central` profiles are *not* enabled,
[NOTE]
[NOTE]
====
====
`spring.profiles` can therefore contain a simple profile name (for example `production`) or a profile expression.
`spring.profiles` can therefore contain a profile name (for example `production`) or a profile expression.
A profile expression allows for more complicated profile logic to be expressed, for example `production & (eu-central | eu-west)`.
A profile expression allows for more complicated profile logic to be expressed, for example `production & (eu-central | eu-west)`.
Check the {spring-framework-docs}/core.html#beans-definition-profiles-java[reference guide] for more details.
Check the {spring-framework-docs}/core.html#beans-definition-profiles-java[reference guide] for more details.
====
====
@ -1466,7 +1466,7 @@ The following units are supported with the simple format:
* `w` for weeks
* `w` for weeks
* `d` for days
* `d` for days
NOTE: The `java.time.Period` type never actually stores the number of weeks, it is simply a shortcut that means "`7 days`".
NOTE: The `java.time.Period` type never actually stores the number of weeks, it is a shortcut that means "`7 days`".
@ -2046,7 +2046,7 @@ If you attempt to do so, making changes to the configuration file results in an
The `<springProfile>` tag lets you optionally include or exclude sections of configuration based on the active Spring profiles.
The `<springProfile>` tag lets you optionally include or exclude sections of configuration based on the active Spring profiles.
Profile sections are supported anywhere within the `<configuration>` element.
Profile sections are supported anywhere within the `<configuration>` element.
Use the `name` attribute to specify which profile accepts the configuration.
Use the `name` attribute to specify which profile accepts the configuration.
The `<springProfile>` tag can contain a simple profile name (for example `staging`) or a profile expression.
The `<springProfile>` tag can contain a profile name (for example `staging`) or a profile expression.
A profile expression allows for more complicated profile logic to be expressed, for example `production & (eu-central | eu-west)`.
A profile expression allows for more complicated profile logic to be expressed, for example `production & (eu-central | eu-west)`.
Check the {spring-framework-docs}/core.html#beans-definition-profiles-java[reference guide] for more details.
Check the {spring-framework-docs}/core.html#beans-definition-profiles-java[reference guide] for more details.
The following listing shows three sample profiles:
The following listing shows three sample profiles:
@ -2165,7 +2165,7 @@ If you have not yet developed a Spring Boot web application, you can follow the
[[boot-features-spring-mvc]]
[[boot-features-spring-mvc]]
=== The "`Spring Web MVC Framework`"
=== The "`Spring Web MVC Framework`"
The {spring-framework-docs}/web.html#mvc[Spring Web MVC framework] (often referred to as simply "`Spring MVC`") is a rich "`model view controller`" web framework.
The {spring-framework-docs}/web.html#mvc[Spring Web MVC framework] (often referred to as "`Spring MVC`") is a rich "`model view controller`" web framework.
Spring MVC lets you create special `@Controller` or `@RestController` beans to handle incoming HTTP requests.
Spring MVC lets you create special `@Controller` or `@RestController` beans to handle incoming HTTP requests.
Methods in your controller are mapped to HTTP by using `@RequestMapping` annotations.
Methods in your controller are mapped to HTTP by using `@RequestMapping` annotations.
@ -2415,7 +2415,7 @@ If you understand the caveats and would still like your application to use suffi
spring.mvc.pathmatch.use-suffix-pattern=true
spring.mvc.pathmatch.use-suffix-pattern=true
----
----
Alternatively, rather than open all suffix patterns, it's more secure to just support registered suffix patterns:
Alternatively, rather than open all suffix patterns, it's more secure to only support registered suffix patterns:
@ -3360,7 +3360,7 @@ https://oauth.net/2/[OAuth2] is a widely used authorization framework that is su
[[boot-features-security-oauth2-client]]
[[boot-features-security-oauth2-client]]
==== Client
==== Client
If you have `spring-security-oauth2-client` on your classpath, you can take advantage of some auto-configuration to make it easy to set up an OAuth2/Open ID Connect clients.
If you have `spring-security-oauth2-client` on your classpath, you can take advantage of some auto-configuration to set up an OAuth2/Open ID Connect clients.
This configuration makes use of the properties under `OAuth2ClientProperties`.
This configuration makes use of the properties under `OAuth2ClientProperties`.
The same properties are applicable to both servlet and reactive applications.
The same properties are applicable to both servlet and reactive applications.
@ -3499,7 +3499,7 @@ Until then, you can use the `spring-security-oauth2-autoconfigure` module to eas
[[boot-features-security-saml2-relying-party]]
[[boot-features-security-saml2-relying-party]]
==== Relying Party
==== Relying Party
If you have `spring-security-saml2-service-provider` on your classpath, you can take advantage of some auto-configuration to make it easy to set up a SAML 2.0 Relying Party.
If you have `spring-security-saml2-service-provider` on your classpath, you can take advantage of some auto-configuration to set up a SAML 2.0 Relying Party.
This configuration makes use of the properties under `Saml2RelyingPartyProperties`.
This configuration makes use of the properties under `Saml2RelyingPartyProperties`.
A relying party registration represents a paired configuration between an Identity Provider, IDP, and a Service Provider, SP.
A relying party registration represents a paired configuration between an Identity Provider, IDP, and a Service Provider, SP.
@ -3720,8 +3720,8 @@ The `spring-boot-starter-data-jpa` POM provides a quick way to get started.
It provides the following key dependencies:
It provides the following key dependencies:
* Hibernate: One of the most popular JPA implementations.
* Hibernate: One of the most popular JPA implementations.
* Spring Data JPA: Makes it easy to implement JPA-based repositories.
* Spring Data JPA: Helps you to implement JPA-based repositories.
* Spring ORMs: Core ORM support from the Spring Framework.
* Spring ORM: Core ORM support from the Spring Framework.
TIP: We do not go into too many details of JPA or {spring-data}[Spring Data] here.
TIP: We do not go into too many details of JPA or {spring-data}[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 {spring-data-jpa}[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 {spring-data-jpa}[Spring Data JPA] and https://hibernate.org/orm/documentation/[Hibernate] reference documentation.
@ -4908,7 +4908,7 @@ Spring Boot auto-configures the cache infrastructure as long as caching support
NOTE: Check the {spring-framework-docs}/integration.html#cache[relevant section] of the Spring Framework reference for more details.
NOTE: Check the {spring-framework-docs}/integration.html#cache[relevant section] of the Spring Framework reference for more details.
In a nutshell, adding caching to an operation of your service is as easy as adding the relevant annotation to its method, as shown in the following example:
In a nutshell, to add caching to an operation of your service add the relevant annotation to its method, as shown in the following example:
[source,java,indent=0]
[source,java,indent=0]
----
----
@ -5662,12 +5662,12 @@ Spring Boot auto-configures the required `KafkaStreamsConfiguration` bean as lon
Enabling Kafka Streams means that the application id and bootstrap servers must be set.
Enabling Kafka Streams means that the application id and bootstrap servers must be set.
The former can be configured using `spring.kafka.streams.application-id`, defaulting to `spring.application.name` if not set.
The former can be configured using `spring.kafka.streams.application-id`, defaulting to `spring.application.name` if not set.
The latter can be set globally or specifically overridden just for streams.
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.
Several additional properties are available using dedicated properties; other arbitrary Kafka properties can be set using the `spring.kafka.streams.properties` namespace.
See also <<boot-features-kafka-extra-props>> for more information.
See also <<boot-features-kafka-extra-props>> for more information.
To use the factory bean, simply wire `StreamsBuilder` into your `@Bean` as shown in the following example:
To use the factory bean, wire `StreamsBuilder` into your `@Bean` as shown in the following example:
[source,java,indent=0]
[source,java,indent=0]
----
----
@ -5903,7 +5903,7 @@ For instance, the following service triggers the validation of the first argumen
[[boot-features-email]]
[[boot-features-email]]
== Sending Email
== Sending Email
The Spring Framework provides an easy abstraction for sending email by using the `JavaMailSender` interface, and Spring Boot provides auto-configuration for it as well as a starter module.
The Spring Framework provides an abstraction for sending email by using the `JavaMailSender` interface, and Spring Boot provides auto-configuration for it as well as a starter module.
TIP: See the {spring-framework-docs}/integration.html#mail[reference documentation] for a detailed explanation of how you can use `JavaMailSender`.
TIP: See the {spring-framework-docs}/integration.html#mail[reference documentation] for a detailed explanation of how you can use `JavaMailSender`.
@ -7337,7 +7337,7 @@ The following example shows the `@WebServiceClientTest` annotation in use:
Each slice provides one or more `@AutoConfigure...` annotations that namely defines the auto-configurations that should be included as part of a slice.
Each slice provides one or more `@AutoConfigure...` annotations that namely defines the auto-configurations that should be included as part of a slice.
Additional auto-configurations can be added by creating a custom `@AutoConfigure...` annotation or simply by adding `@ImportAutoConfiguration` to the test as shown in the following example:
Additional auto-configurations can be added by creating a custom `@AutoConfigure...` annotation or by adding `@ImportAutoConfiguration` to the test as shown in the following example:
[source,java,indent=0]
[source,java,indent=0]
----
----
@ -7900,7 +7900,7 @@ Make sure that configuration keys are documented by adding field javadoc for eac
}
}
----
----
NOTE: You should only use simple text with `@ConfigurationProperties` field Javadoc, since they are not processed before being added to the JSON.
NOTE: You should only use plain text with `@ConfigurationProperties` field Javadoc, since they are not processed before being added to the JSON.
Here are some rules we follow internally to make sure descriptions are consistent:
Here are some rules we follow internally to make sure descriptions are consistent:
You are free to use any of the standard Spring Framework techniques to define your beans and their injected dependencies.
You are free to use any of the standard Spring Framework techniques to define your beans and their injected dependencies.
For simplicity, we often find that using `@ComponentScan` (to find your beans) and using `@Autowired` (to do constructor injection) works well.
We often find that using `@ComponentScan` (to find your beans) and using `@Autowired` (to do constructor injection) works well.
If you structure your code as suggested above (locating your application class in a root package), you can add `@ComponentScan` without any arguments.
If you structure your code as suggested above (locating your application class in a root package), you can add `@ComponentScan` without any arguments.
All of your application components (`@Component`, `@Service`, `@Repository`, `@Controller` etc.) are automatically registered as Spring Beans.
All of your application components (`@Component`, `@Service`, `@Repository`, `@Controller` etc.) are automatically registered as Spring Beans.
@ -417,7 +417,7 @@ In this example, `Application` is just like any other Spring Boot application ex
[[using-boot-running-your-application]]
[[using-boot-running-your-application]]
== Running Your Application
== Running Your Application
One of the biggest advantages of packaging your application as a jar and using an embedded HTTP server is that you can run your application as you would any other.
One of the biggest advantages of packaging your application as a jar and using an embedded HTTP server is that you can run your application as you would any other.
Debugging Spring Boot applications is also easy.
The sample applies to debugging Spring Boot applications.
You do not need any special IDE plugins or extensions.
You do not need any special IDE plugins or extensions.
NOTE: This section only covers jar based packaging.
NOTE: This section only covers jar based packaging.
@ -427,7 +427,7 @@ If you choose to package your application as a war file, you should refer to you
[[using-boot-running-from-an-ide]]
[[using-boot-running-from-an-ide]]
=== Running from an IDE
=== Running from an IDE
You can run a Spring Boot application from your IDE as a simple Java application.
You can run a Spring Boot application from your IDE as a Java application.
However, you first need to import your project.
However, you first need to import your project.
Import steps vary depending on your IDE and build system.
Import steps vary depending on your IDE and build system.
Most IDEs can import Maven projects directly.
Most IDEs can import Maven projects directly.
@ -503,7 +503,7 @@ You might also want to use the `JAVA_OPTS` operating system environment variable
[[using-boot-hot-swapping]]
[[using-boot-hot-swapping]]
=== Hot Swapping
=== Hot Swapping
Since Spring Boot applications are just plain Java applications, JVM hot-swapping should work out of the box.
Since Spring Boot applications are plain Java applications, JVM hot-swapping should work out of the box.
JVM hot swapping is somewhat limited with the bytecode that it can replace.
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.
For a more complete solution, https://www.jrebel.com/products/jrebel[JRebel] can be used.
When you apply the {dependency-management-plugin}[`io.spring.dependency-management`] plugin, Spring Boot's plugin will automatically <<reacting-to-other-plugins-dependency-management,import the `spring-boot-dependencies` bom>> from the version of Spring Boot that you are using.
When you apply the {dependency-management-plugin}[`io.spring.dependency-management`] plugin, Spring Boot's plugin will automatically <<reacting-to-other-plugins-dependency-management,import the `spring-boot-dependencies` bom>> from the version of Spring Boot that you are using.
This provides a similar dependency management experience to the one that's enjoyed by Maven users.
This provides a similar dependency management experience to the one that's enjoyed by Maven users.
For example, it allows you to omit version numbers when declaring dependencies that are managed in the bom.
For example, it allows you to omit version numbers when declaring dependencies that are managed in the bom.
To make use of this functionality, simply declare dependencies in the usual way but omit the version number:
To make use of this functionality, declare dependencies in the usual way but omit the version number:
@ -357,7 +357,7 @@ Again, if you are using `spring-boot-starter-parent`, this can be simplified as
[[repackage-example-custom-name]]
[[repackage-example-custom-name]]
==== Custom Name
==== Custom Name
If you need the repackaged jar to have a different local name than the one defined by the `artifactId` attribute of the project, simply use the standard `finalName`, as shown in the following example:
If you need the repackaged jar to have a different local name than the one defined by the `artifactId` attribute of the project, use the standard `finalName`, as shown in the following example: