You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix/configuration-metadata.adoc
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,8 @@ For example, `server.port` and `server.address` might be specified in `applicati
91
91
The "`groups`" are higher level items that do not themselves specify a value but instead provide a contextual grouping for properties.
92
92
For example, the `server.port` and `server.address` properties are part of the `server` group.
93
93
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.
95
96
96
97
Finally, "`hints`" are additional information used to assist the user in configuring a given property.
97
98
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
108
109
109
110
| `name`
110
111
| String
111
-
| The full name of the group. This attribute is mandatory.
112
+
| The full name of the group.
113
+
This attribute is mandatory.
112
114
113
115
| `type`
114
116
| String
@@ -318,7 +320,8 @@ The JSON object contained in the `providers` attribute of each `hint` element ca
318
320
319
321
[[configuration-metadata-repeated-items]]
320
322
==== 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.
322
325
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.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/main/asciidoc/deployment.adoc
+14-7Lines changed: 14 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -400,7 +400,8 @@ A fully executable jar can be executed like any other executable binary or it ca
400
400
This makes it very easy to install and manage Spring Boot applications in common production environments.
401
401
402
402
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.
404
405
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.
405
406
406
407
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
520
521
This will prevent any user, including root, from modifying the jar.
521
522
522
523
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:
524
526
525
527
[indent=0,subs="verbatim,quotes,attributes"]
526
528
----
@@ -650,17 +652,20 @@ The following property substitutions are supported with the default script:
650
652
|
651
653
652
654
| `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
654
657
|
655
658
|
656
659
657
660
| `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
659
663
|
660
664
|
661
665
662
666
| `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
664
669
|
665
670
|
666
671
@@ -676,7 +681,8 @@ The following property substitutions are supported with the default script:
676
681
| `true`
677
682
678
683
| `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
680
686
| 60
681
687
| 60
682
688
|===
@@ -738,7 +744,8 @@ The following environment properties are supported with the default script:
738
744
| The time in seconds to wait when stopping the application before forcing a shutdown (`60` by default).
739
745
|===
740
746
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.
742
749
See the https://www.freedesktop.org/software/systemd/man/systemd.service.html[service unit configuration man page] for more details.
The `${..}` style conflicts with Spring's own property placeholder mechanism.
214
215
To use Spring property placeholders together with automatic expansion, escape the Spring property placeholders as follows: `\${..}`.
215
216
216
217
@@ -644,7 +645,8 @@ Generally, you should first consider using one of the many available configurati
644
645
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.
645
646
See the list of <<common-application-properties>>.
646
647
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`].
648
650
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).
649
651
650
652
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
1167
1169
You can override `FreeMarkerViewResolver` by providing a bean of the same name.
1168
1170
* If you use Groovy templates (actually, if `groovy-templates` is on your classpath), you also have a `GroovyMarkupViewResolver` named '`groovyMarkupViewResolver`'.
1169
1171
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.
1171
1174
1172
1175
For more detail, see the following sections:
1173
1176
@@ -1503,7 +1506,8 @@ The following example shows how to define a JDBC data source by setting properti
1503
1506
1504
1507
However, there is a catch.
1505
1508
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:
1507
1511
1508
1512
[source,properties,indent=0]
1509
1513
----
@@ -1559,7 +1563,8 @@ See "`<<spring-boot-features.adoc#boot-features-configure-datasource>>`" in the
1559
1563
If you need to configure multiple data sources, you can apply the same tricks that are described in the previous section.
1560
1564
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.
1561
1565
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:
TIP: `firstDataSourceProperties` has to be flagged as `@Primary` so that the database initializer feature uses your copy (if you use the initializer).
1570
1575
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:
1572
1578
1573
1579
[source,properties,indent=0]
1574
1580
----
@@ -1704,7 +1710,8 @@ See {spring-boot-autoconfigure-module-code}/orm/jpa/HibernateJpaAutoConfiguratio
1704
1710
Hibernate {hibernate-docs}#caching[second-level cache] can be configured for a range of cache providers.
1705
1711
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.
1706
1712
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.
1708
1715
Then, add a `HibernatePropertiesCustomizer` bean as shown in the following example:
1709
1716
1710
1717
[source,java,indent=0]
@@ -1884,7 +1891,8 @@ This is controlled through two external properties:
1884
1891
You can set `spring.jpa.hibernate.ddl-auto` explicitly and the standard Hibernate property values are `none`, `validate`, `update`, `create`, and `create-drop`.
1885
1892
Spring Boot chooses a default value for you based on whether it thinks your database is embedded.
1886
1893
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.
1888
1896
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.
1889
1897
You either have to set `ddl-auto` explicitly or use one of the other mechanisms to initialize the database.
1890
1898
@@ -1973,7 +1981,8 @@ Assume the following:
1973
1981
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).
1974
1982
The list of supported databases is available in {spring-boot-module-code}/jdbc/DatabaseDriver.java[`DatabaseDriver`].
1975
1983
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`.
1977
1986
1978
1987
{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.
1979
1988
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
2096
2105
2097
2106
[[howto-actuator]]
2098
2107
== 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.
2100
2110
2101
2111
2102
2112
@@ -2175,7 +2185,8 @@ You can switch on the valve by adding some entries to `application.properties`,
2175
2185
server.tomcat.protocol-header=x-forwarded-proto
2176
2186
----
2177
2187
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.)
2179
2190
2180
2191
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:
2181
2192
@@ -2197,7 +2208,8 @@ To configure Spring Security to require a secure channel for all (or some) reque
2197
2208
2198
2209
[[howto-hotswapping]]
2199
2210
== 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.
2201
2213
2202
2214
2203
2215
@@ -2749,7 +2761,8 @@ See the <<howto-build-an-application-context-hierarchy, entry on building a hier
2749
2761
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.
2750
2762
2751
2763
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`].
0 commit comments