Skip to content

Commit 0074a7c

Browse files
committed
Merge branch '2.1.x'
2 parents a56eb4b + 4f21b51 commit 0074a7c

File tree

8 files changed

+162
-98
lines changed

8 files changed

+162
-98
lines changed

spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix/configuration-metadata.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ For example, `server.port` and `server.address` might be specified in `applicati
9191
The "`groups`" are higher level items that do not themselves specify a value but instead provide a contextual grouping for properties.
9292
For example, the `server.port` and `server.address` properties are part of the `server` group.
9393

94-
NOTE: It is not required that every "`property`" has a "`group`". Some properties might exist in their own right.
94+
NOTE: It is not required that every "`property`" has a "`group`".
95+
Some properties might exist in their own right.
9596

9697
Finally, "`hints`" are additional information used to assist the user in configuring a given property.
9798
For example, when a developer is configuring the `spring.jpa.hibernate.ddl-auto` property, a tool can use the hints to offer some auto-completion help for the `none`, `validate`, `update`, `create`, and `create-drop` values.
@@ -108,7 +109,8 @@ The JSON object contained in the `groups` array can contain the attributes shown
108109

109110
| `name`
110111
| String
111-
| The full name of the group. This attribute is mandatory.
112+
| The full name of the group.
113+
This attribute is mandatory.
112114

113115
| `type`
114116
| String
@@ -318,7 +320,8 @@ The JSON object contained in the `providers` attribute of each `hint` element ca
318320

319321
[[configuration-metadata-repeated-items]]
320322
==== Repeated Metadata Items
321-
Objects with the same "`property`" and "`group`" name can appear multiple times within a metadata file. For example, you could bind two separate classes to the same prefix, with each having potentially overlapping property names.
323+
Objects with the same "`property`" and "`group`" name can appear multiple times within a metadata file.
324+
For example, you could bind two separate classes to the same prefix, with each having potentially overlapping property names.
322325
While the same names appearing in the metadata multiple times should not be common, consumers of metadata should take care to ensure that they support it.
323326

324327

spring-boot-project/spring-boot-docs/src/main/asciidoc/deployment.adoc

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,8 @@ A fully executable jar can be executed like any other executable binary or it ca
400400
This makes it very easy to install and manage Spring Boot applications in common production environments.
401401

402402
CAUTION: Fully executable jars work by embedding an extra script at the front of the file.
403-
Currently, some tools do not accept this format, so you may not always be able to use this technique. For example, `jar -xf` may silently fail to extract a jar or war that has been made fully executable.
403+
Currently, some tools do not accept this format, so you may not always be able to use this technique.
404+
For example, `jar -xf` may silently fail to extract a jar or war that has been made fully executable.
404405
It is recommended that you make your jar or war fully executable only if you intend to execute it directly, rather than running it with `java -jar`or deploying it to a servlet container.
405406

406407
To create a '`fully executable`' jar with Maven, use the following plugin configuration:
@@ -520,7 +521,8 @@ One way to protect against this is to make it immutable by using `chattr`, as sh
520521
This will prevent any user, including root, from modifying the jar.
521522

522523
If root is used to control the application's service and you <<deployment-script-customization-conf-file, use a `.conf` file>> to customize its startup, the `.conf` file is read and evaluated by the root user.
523-
It should be secured accordingly. Use `chmod` so that the file can only be read by the owner and use `chown` to make root the owner, as shown in the following example:
524+
It should be secured accordingly.
525+
Use `chmod` so that the file can only be read by the owner and use `chown` to make root the owner, as shown in the following example:
524526

525527
[indent=0,subs="verbatim,quotes,attributes"]
526528
----
@@ -650,17 +652,20 @@ The following property substitutions are supported with the default script:
650652
|
651653

652654
| `logFolder`
653-
| Default value for `LOG_FOLDER`. Only valid for an `init.d` service
655+
| Default value for `LOG_FOLDER`.
656+
Only valid for an `init.d` service
654657
|
655658
|
656659

657660
| `logFilename`
658-
| Default value for `LOG_FILENAME`. Only valid for an `init.d` service
661+
| Default value for `LOG_FILENAME`.
662+
Only valid for an `init.d` service
659663
|
660664
|
661665

662666
| `pidFolder`
663-
| Default value for `PID_FOLDER`. Only valid for an `init.d` service
667+
| Default value for `PID_FOLDER`.
668+
Only valid for an `init.d` service
664669
|
665670
|
666671

@@ -676,7 +681,8 @@ The following property substitutions are supported with the default script:
676681
| `true`
677682

678683
| `stopWaitTime`
679-
| Default value for `STOP_WAIT_TIME` in seconds. Only valid for an `init.d` service
684+
| Default value for `STOP_WAIT_TIME` in seconds.
685+
Only valid for an `init.d` service
680686
| 60
681687
| 60
682688
|===
@@ -738,7 +744,8 @@ The following environment properties are supported with the default script:
738744
| The time in seconds to wait when stopping the application before forcing a shutdown (`60` by default).
739745
|===
740746

741-
NOTE: The `PID_FOLDER`, `LOG_FOLDER`, and `LOG_FILENAME` variables are only valid for an `init.d` service. For `systemd`, the equivalent customizations are made by using the '`service`' script.
747+
NOTE: The `PID_FOLDER`, `LOG_FOLDER`, and `LOG_FILENAME` variables are only valid for an `init.d` service.
748+
For `systemd`, the equivalent customizations are made by using the '`service`' script.
742749
See the https://www.freedesktop.org/software/systemd/man/systemd.service.html[service unit configuration man page] for more details.
743750

744751

spring-boot-project/spring-boot-docs/src/main/asciidoc/getting-started.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ In those cases, see <<using-boot-maven-without-a-parent>> for an alternative sol
182182

183183
[[getting-started-gradle-installation]]
184184
==== Gradle Installation
185-
Spring Boot is compatible with 5.x. 4.10 is also supported but this support is deprecated and will be removed in a future release.
185+
Spring Boot is compatible with 5.x.
186+
4.10 is also supported but this support is deprecated and will be removed in a future release.
186187
If you do not already have Gradle installed, you can follow the instructions at https://gradle.org.
187188

188189
Spring Boot dependencies can be declared by using the `org.springframework.boot` `group`.

spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ You can then refer to your Gradle project's properties by using placeholders, as
210210
app.description=${description}
211211
----
212212

213-
NOTE: Gradle's `expand` method uses Groovy's `SimpleTemplateEngine`, which transforms `${..}` tokens. The `${..}` style conflicts with Spring's own property placeholder mechanism.
213+
NOTE: Gradle's `expand` method uses Groovy's `SimpleTemplateEngine`, which transforms `${..}` tokens.
214+
The `${..}` style conflicts with Spring's own property placeholder mechanism.
214215
To use Spring property placeholders together with automatic expansion, escape the Spring property placeholders as follows: `\${..}`.
215216

216217

@@ -644,7 +645,8 @@ Generally, you should first consider using one of the many available configurati
644645
The `server.{asterisk}` namespace is quite useful here, and it includes namespaces like `server.tomcat.{asterisk}`, `server.jetty.{asterisk}` and others, for server-specific features.
645646
See the list of <<common-application-properties>>.
646647

647-
The previous sections covered already many common use cases, such as compression, SSL or HTTP/2. However, if a configuration key doesn't exist for your use case, you should then look at {spring-boot-module-api}/web/server/WebServerFactoryCustomizer.html[`WebServerFactoryCustomizer`].
648+
The previous sections covered already many common use cases, such as compression, SSL or HTTP/2.
649+
However, if a configuration key doesn't exist for your use case, you should then look at {spring-boot-module-api}/web/server/WebServerFactoryCustomizer.html[`WebServerFactoryCustomizer`].
648650
You can declare such a component and get access to the server factory relevant to your choice: you should select the variant for the chosen Server (Tomcat, Jetty, Reactor Netty, Undertow) and the chosen web stack (Servlet or Reactive).
649651

650652
The example below is for Tomcat with the `spring-boot-starter-web` (Servlet stack):
@@ -1167,7 +1169,8 @@ If you add your own, you have to be aware of the order and in which position you
11671169
You can override `FreeMarkerViewResolver` by providing a bean of the same name.
11681170
* If you use Groovy templates (actually, if `groovy-templates` is on your classpath), you also have a `GroovyMarkupViewResolver` named '`groovyMarkupViewResolver`'.
11691171
It looks for resources in a loader path by surrounding the view name with a prefix and suffix (externalized to `spring.groovy.template.prefix` and `spring.groovy.template.suffix`).
1170-
The prefix and suffix have default values of '`classpath:/templates/`' and '`.tpl`', respectively. You can override `GroovyMarkupViewResolver` by providing a bean of the same name.
1172+
The prefix and suffix have default values of '`classpath:/templates/`' and '`.tpl`', respectively.
1173+
You can override `GroovyMarkupViewResolver` by providing a bean of the same name.
11711174

11721175
For more detail, see the following sections:
11731176

@@ -1503,7 +1506,8 @@ The following example shows how to define a JDBC data source by setting properti
15031506

15041507
However, there is a catch.
15051508
Because the actual type of the connection pool is not exposed, no keys are generated in the metadata for your custom `DataSource` and no completion is available in your IDE (because the `DataSource` interface exposes no properties).
1506-
Also, if you happen to have Hikari on the classpath, this basic setup does not work, because Hikari has no `url` property (but does have a `jdbcUrl` property). In that case, you must rewrite your configuration as follows:
1509+
Also, if you happen to have Hikari on the classpath, this basic setup does not work, because Hikari has no `url` property (but does have a `jdbcUrl` property).
1510+
In that case, you must rewrite your configuration as follows:
15071511

15081512
[source,properties,indent=0]
15091513
----
@@ -1559,7 +1563,8 @@ See "`<<spring-boot-features.adoc#boot-features-configure-datasource>>`" in the
15591563
If you need to configure multiple data sources, you can apply the same tricks that are described in the previous section.
15601564
You must, however, mark one of the `DataSource` instances as `@Primary`, because various auto-configurations down the road expect to be able to get one by type.
15611565

1562-
If you create your own `DataSource`, the auto-configuration backs off. In the following example, we provide the _exact_ same feature set as the auto-configuration provides on the primary data source:
1566+
If you create your own `DataSource`, the auto-configuration backs off.
1567+
In the following example, we provide the _exact_ same feature set as the auto-configuration provides on the primary data source:
15631568

15641569
[source,java,indent=0,subs="verbatim,quotes,attributes"]
15651570
----
@@ -1568,7 +1573,8 @@ include::{code-examples}/jdbc/SimpleTwoDataSourcesExample.java[tag=configuration
15681573

15691574
TIP: `firstDataSourceProperties` has to be flagged as `@Primary` so that the database initializer feature uses your copy (if you use the initializer).
15701575

1571-
Both data sources are also bound for advanced customizations. For instance, you could configure them as follows:
1576+
Both data sources are also bound for advanced customizations.
1577+
For instance, you could configure them as follows:
15721578

15731579
[source,properties,indent=0]
15741580
----
@@ -1704,7 +1710,8 @@ See {spring-boot-autoconfigure-module-code}/orm/jpa/HibernateJpaAutoConfiguratio
17041710
Hibernate {hibernate-docs}#caching[second-level cache] can be configured for a range of cache providers.
17051711
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.
17061712

1707-
If you're using JCache, this is pretty easy. First, make sure that `org.hibernate:hibernate-jcache` is available on the classpath.
1713+
If you're using JCache, this is pretty easy.
1714+
First, make sure that `org.hibernate:hibernate-jcache` is available on the classpath.
17081715
Then, add a `HibernatePropertiesCustomizer` bean as shown in the following example:
17091716

17101717
[source,java,indent=0]
@@ -1884,7 +1891,8 @@ This is controlled through two external properties:
18841891
You can set `spring.jpa.hibernate.ddl-auto` explicitly and the standard Hibernate property values are `none`, `validate`, `update`, `create`, and `create-drop`.
18851892
Spring Boot chooses a default value for you based on whether it thinks your database is embedded.
18861893
It defaults to `create-drop` if no schema manager has been detected or `none` in all other cases.
1887-
An embedded database is detected by looking at the `Connection` type. `hsqldb`, `h2`, and `derby` are embedded, and others are not.
1894+
An embedded database is detected by looking at the `Connection` type.
1895+
`hsqldb`, `h2`, and `derby` are embedded, and others are not.
18881896
Be careful when switching from in-memory to a '`real`' database that you do not make assumptions about the existence of the tables and data in the new platform.
18891897
You either have to set `ddl-auto` explicitly or use one of the other mechanisms to initialize the database.
18901898

@@ -1973,7 +1981,8 @@ Assume the following:
19731981
Rather than using `db/migration`, the preceding configuration sets the folder to use according to the type of the database (such as `db/migration/mysql` for MySQL).
19741982
The list of supported databases is available in {spring-boot-module-code}/jdbc/DatabaseDriver.java[`DatabaseDriver`].
19751983

1976-
Migrations can also be written in Java. Flyway will be auto-configured with any beans that implement `JavaMigration`.
1984+
Migrations can also be written in Java.
1985+
Flyway will be auto-configured with any beans that implement `JavaMigration`.
19771986

19781987
{spring-boot-autoconfigure-module-code}/flyway/FlywayProperties.java[`FlywayProperties`] provides most of Flyway's settings and a small set of additional properties that can be used to disable the migrations or switch off the location checking.
19791988
If you need more control over the configuration, consider registering a `FlywayConfigurationCustomizer` bean.
@@ -2096,7 +2105,8 @@ See {spring-boot-autoconfigure-module-code}/batch/BatchAutoConfiguration.java[Ba
20962105

20972106
[[howto-actuator]]
20982107
== Actuator
2099-
Spring Boot includes the Spring Boot Actuator. This section answers questions that often arise from its use.
2108+
Spring Boot includes the Spring Boot Actuator.
2109+
This section answers questions that often arise from its use.
21002110

21012111

21022112

@@ -2175,7 +2185,8 @@ You can switch on the valve by adding some entries to `application.properties`,
21752185
server.tomcat.protocol-header=x-forwarded-proto
21762186
----
21772187

2178-
(The presence of either of those properties switches on the valve. Alternatively, you can add the `RemoteIpValve` by adding a `TomcatServletWebServerFactory` bean.)
2188+
(The presence of either of those properties switches on the valve.
2189+
Alternatively, you can add the `RemoteIpValve` by adding a `TomcatServletWebServerFactory` bean.)
21792190

21802191
To configure Spring Security to require a secure channel for all (or some) requests, consider adding your own `WebSecurityConfigurerAdapter` that adds the following `HttpSecurity` configuration:
21812192

@@ -2197,7 +2208,8 @@ To configure Spring Security to require a secure channel for all (or some) reque
21972208

21982209
[[howto-hotswapping]]
21992210
== Hot Swapping
2200-
Spring Boot supports hot swapping. This section answers questions about how it works.
2211+
Spring Boot supports hot swapping.
2212+
This section answers questions about how it works.
22012213

22022214

22032215

@@ -2749,7 +2761,8 @@ See the <<howto-build-an-application-context-hierarchy, entry on building a hier
27492761
An existing parent context that contains web-specific features usually needs to be broken up so that all the `ServletContextAware` components are in the child context.
27502762

27512763
Applications that are not already Spring applications might be convertible to Spring Boot applications, and the previously mentioned guidance may help.
2752-
However, you may yet encounter problems. In that case, we suggest https://stackoverflow.com/questions/tagged/spring-boot[asking questions on Stack Overflow with a tag of `spring-boot`].
2764+
However, you may yet encounter problems.
2765+
In that case, we suggest https://stackoverflow.com/questions/tagged/spring-boot[asking questions on Stack Overflow with a tag of `spring-boot`].
27532766

27542767

27552768

0 commit comments

Comments
 (0)