Commit 5d8a64e1 authored by Andy Wilkinson's avatar Andy Wilkinson

Validate section IDs in the reference documentation

See gh-26307
parent 5a3c354e
...@@ -44,6 +44,7 @@ dependencies { ...@@ -44,6 +44,7 @@ dependencies {
actuatorApiDocumentation(project(path: ":spring-boot-project:spring-boot-actuator-autoconfigure", configuration: "documentation")) actuatorApiDocumentation(project(path: ":spring-boot-project:spring-boot-actuator-autoconfigure", configuration: "documentation"))
asciidoctorExtensions("io.spring.asciidoctor:spring-asciidoctor-extensions-spring-boot") asciidoctorExtensions("io.spring.asciidoctor:spring-asciidoctor-extensions-spring-boot")
asciidoctorExtensions("io.spring.asciidoctor:spring-asciidoctor-extensions-section-ids")
asciidoctorExtensions(project(path: ":spring-boot-project:spring-boot-actuator-autoconfigure")) asciidoctorExtensions(project(path: ":spring-boot-project:spring-boot-actuator-autoconfigure"))
asciidoctorExtensions(project(path: ":spring-boot-project:spring-boot-autoconfigure")) asciidoctorExtensions(project(path: ":spring-boot-project:spring-boot-autoconfigure"))
asciidoctorExtensions(project(path: ":spring-boot-project:spring-boot-devtools")) asciidoctorExtensions(project(path: ":spring-boot-project:spring-boot-devtools"))
......
[appendix] [appendix]
[[auto-configuration-classes]] [[appendix.auto-configuration-classes]]
= Auto-configuration Classes = Auto-configuration Classes
include::attributes.adoc[] include::attributes.adoc[]
...@@ -9,7 +9,7 @@ Remember to also look at the conditions report in your application for more deta ...@@ -9,7 +9,7 @@ Remember to also look at the conditions report in your application for more deta
[[auto-configuration-classes.core]] [[appendix.auto-configuration-classes.core]]
== spring-boot-autoconfigure == spring-boot-autoconfigure
The following auto-configuration classes are from the `spring-boot-autoconfigure` module: The following auto-configuration classes are from the `spring-boot-autoconfigure` module:
...@@ -17,7 +17,7 @@ include::auto-configuration-classes/spring-boot-autoconfigure.adoc[] ...@@ -17,7 +17,7 @@ include::auto-configuration-classes/spring-boot-autoconfigure.adoc[]
[[auto-configuration-classes.actuator]] [[appendix.auto-configuration-classes.actuator]]
== spring-boot-actuator-autoconfigure == spring-boot-actuator-autoconfigure
The following auto-configuration classes are from the `spring-boot-actuator-autoconfigure` module: The following auto-configuration classes are from the `spring-boot-actuator-autoconfigure` module:
......
...@@ -186,7 +186,7 @@ This section contains three examples of using `findmainclass`. ...@@ -186,7 +186,7 @@ This section contains three examples of using `findmainclass`.
[[build-tool-plugins.other-build-systems]] [[build-tool-plugins.other-build-systems]]
== Supporting Other Build Systems == Supporting Other Build Systems
If you want to use a build tool other than Maven, Gradle, or Ant, you likely need to develop your own plugin. If you want to use a build tool other than Maven, Gradle, or Ant, you likely need to develop your own plugin.
Executable jars need to follow a specific format and certain entries need to be written in an uncompressed form (see the "`<<executable-jar.adoc#executable-jar, executable jar format>>`" section in the appendix for details). Executable jars need to follow a specific format and certain entries need to be written in an uncompressed form (see the "`<<executable-jar.adoc#appendix.executable-jar, executable jar format>>`" section in the appendix for details).
The Spring Boot Maven and Gradle plugins both make use of `spring-boot-loader-tools` to actually generate jars. The Spring Boot Maven and Gradle plugins both make use of `spring-boot-loader-tools` to actually generate jars.
If you need to, you may use this library directly. If you need to, you may use this library directly.
...@@ -240,6 +240,6 @@ The following example shows a typical repackage implementation: ...@@ -240,6 +240,6 @@ The following example shows a typical repackage implementation:
[[build-tool-plugins.whats-next]] [[build-tool-plugins.whats-next]]
== What to Read Next == What to Read Next
If you are interested in how the build tool plugins work, you can look at the {spring-boot-code}/spring-boot-project/spring-boot-tools[`spring-boot-tools`] module on GitHub. If you are interested in how the build tool plugins work, you can look at the {spring-boot-code}/spring-boot-project/spring-boot-tools[`spring-boot-tools`] module on GitHub.
More technical details of the executable jar format are covered in <<appendix-executable-jar-format#executable-jar,the appendix>>. More technical details of the executable jar format are covered in <<appendix-executable-jar-format#appendix.executable-jar,the appendix>>.
If you have specific build-related questions, you can check out the "`<<howto.adoc#howto, how-to>>`" guides. If you have specific build-related questions, you can check out the "`<<howto.adoc#howto, how-to>>`" guides.
...@@ -171,7 +171,7 @@ Doing so consults Spring Boot's default dependency metadata to deduce the artifa ...@@ -171,7 +171,7 @@ Doing so consults Spring Boot's default dependency metadata to deduce the artifa
NOTE: The default metadata is tied to the version of the CLI that you use. NOTE: The default metadata is tied to the version of the CLI that you use.
It changes only when you move to a new version of the CLI, putting you in control of when the versions of your dependencies may change. It changes only when you move to a new version of the CLI, putting you in control of when the versions of your dependencies may change.
A table showing the dependencies and their versions that are included in the default metadata can be found in the <<dependency-versions.adoc#dependency-versions,appendix>>. A table showing the dependencies and their versions that are included in the default metadata can be found in the <<dependency-versions.adoc#appendix.dependency-versions,appendix>>.
......
:numbered!: :numbered!:
[appendix] [appendix]
[[common-application-properties]] [[appendix.common-application-properties]]
= Common Application properties = Common Application properties
include::attributes.adoc[] include::attributes.adoc[]
...@@ -14,96 +14,96 @@ Also, you can define your own properties. ...@@ -14,96 +14,96 @@ Also, you can define your own properties.
[[common-application-properties.core]] [[appendix.common-application-properties.core]]
== Core Properties [[core-properties]] == Core Properties [[core-properties]]
include::config-docs/core.adoc[] include::config-docs/core.adoc[]
[[common-application-properties.cache]] [[appendix.common-application-properties.cache]]
== Cache Properties [[cache-properties]] == Cache Properties [[cache-properties]]
include::config-docs/cache.adoc[] include::config-docs/cache.adoc[]
[[common-application-properties.mail]] [[appendix.common-application-properties.mail]]
== Mail Properties [[mail-properties]] == Mail Properties [[mail-properties]]
include::config-docs/mail.adoc[] include::config-docs/mail.adoc[]
[[common-application-properties.json]] [[appendix.common-application-properties.json]]
== JSON Properties [[json-properties]] == JSON Properties [[json-properties]]
include::config-docs/json.adoc[] include::config-docs/json.adoc[]
[[common-application-properties.data]] [[appendix.common-application-properties.data]]
== Data Properties [[data-properties]] == Data Properties [[data-properties]]
include::config-docs/data.adoc[] include::config-docs/data.adoc[]
[[common-application-properties.transaction]] [[appendix.common-application-properties.transaction]]
== Transaction Properties [[transaction-properties]] == Transaction Properties [[transaction-properties]]
include::config-docs/transaction.adoc[] include::config-docs/transaction.adoc[]
[[common-application-properties.data-migration]] [[appendix.common-application-properties.data-migration]]
== Data Migration Properties [[data-migration-properties]] == Data Migration Properties [[data-migration-properties]]
include::config-docs/data-migration.adoc[] include::config-docs/data-migration.adoc[]
[[common-application-properties.integration]] [[appendix.common-application-properties.integration]]
== Integration Properties [[integration-properties]] == Integration Properties [[integration-properties]]
include::config-docs/integration.adoc[] include::config-docs/integration.adoc[]
[[common-application-properties.web]] [[appendix.common-application-properties.web]]
== Web Properties [[web-properties]] == Web Properties [[web-properties]]
include::config-docs/web.adoc[] include::config-docs/web.adoc[]
[[common-application-properties.templating]] [[appendix.common-application-properties.templating]]
== Templating Properties [[templating-properties]] == Templating Properties [[templating-properties]]
include::config-docs/templating.adoc[] include::config-docs/templating.adoc[]
[[common-application-properties.server]] [[appendix.common-application-properties.server]]
== Server Properties [[server-properties]] == Server Properties [[server-properties]]
include::config-docs/server.adoc[] include::config-docs/server.adoc[]
[[common-application-properties.security]] [[appendix.common-application-properties.security]]
== Security Properties [[security-properties]] == Security Properties [[security-properties]]
include::config-docs/security.adoc[] include::config-docs/security.adoc[]
[[common-application-properties.rsocket]] [[appendix.common-application-properties.rsocket]]
== RSocket Properties [[rsocket-properties]] == RSocket Properties [[rsocket-properties]]
include::config-docs/rsocket.adoc[] include::config-docs/rsocket.adoc[]
[[common-application-properties.actuator]] [[appendix.common-application-properties.actuator]]
== Actuator Properties [[actuator-properties]] == Actuator Properties [[actuator-properties]]
include::config-docs/actuator.adoc[] include::config-docs/actuator.adoc[]
[[common-application-properties.devtools]] [[appendix.common-application-properties.devtools]]
== Devtools Properties [[devtools-properties]] == Devtools Properties [[devtools-properties]]
include::config-docs/devtools.adoc[] include::config-docs/devtools.adoc[]
[[common-application-properties.testing]] [[appendix.common-application-properties.testing]]
== Testing Properties [[testing-properties]] == Testing Properties [[testing-properties]]
include::config-docs/testing.adoc[] include::config-docs/testing.adoc[]
[appendix] [appendix]
[[dependency-versions]] [[appendix.dependency-versions]]
= Dependency versions = Dependency versions
include::attributes.adoc[] include::attributes.adoc[]
...@@ -7,7 +7,7 @@ This appendix provides details of the dependencies that are managed by Spring Bo ...@@ -7,7 +7,7 @@ This appendix provides details of the dependencies that are managed by Spring Bo
[[dependency-versions.coordinates]] [[appendix.dependency-versions.coordinates]]
== Managed Dependency Coordinates == Managed Dependency Coordinates
The following table provides details of all of the dependency versions that are provided by Spring Boot in its CLI (Command Line Interface), Maven dependency management, and Gradle plugin. The following table provides details of all of the dependency versions that are provided by Spring Boot in its CLI (Command Line Interface), Maven dependency management, and Gradle plugin.
...@@ -17,7 +17,7 @@ include::generated-dependency-versions.adoc[] ...@@ -17,7 +17,7 @@ include::generated-dependency-versions.adoc[]
[[dependency-versions.properties]] [[appendix.dependency-versions.properties]]
== Version Properties == Version Properties
The following table provides all properties that can be used to override the versions managed by Spring Boot. The following table provides all properties that can be used to override the versions managed by Spring Boot.
......
...@@ -104,4 +104,4 @@ Finally, we have a few topics for more advanced users: ...@@ -104,4 +104,4 @@ Finally, we have a few topics for more advanced users:
* *Spring Boot Applications Deployment:* <<deployment.adoc#deployment.cloud, Cloud Deployment>> | <<deployment.adoc#deployment.installing.nix-services, OS Service>> * *Spring Boot Applications Deployment:* <<deployment.adoc#deployment.cloud, Cloud Deployment>> | <<deployment.adoc#deployment.installing.nix-services, OS Service>>
* *Build tool plugins:* <<build-tool-plugins.adoc#build-tool-plugins.maven, Maven>> | <<build-tool-plugins.adoc#build-tool-plugins.gradle, Gradle>> * *Build tool plugins:* <<build-tool-plugins.adoc#build-tool-plugins.maven, Maven>> | <<build-tool-plugins.adoc#build-tool-plugins.gradle, Gradle>>
* *Appendix:* <<common-application-properties.adoc#common-application-properties,Application Properties>> | <<configuration-metadata.adoc#configuration-metadata,Configuration Metadata>> | <<auto-configuration-classes.adoc#auto-configuration-classes,Auto-configuration Classes>> | <<test-auto-configuration.adoc#test-auto-configuration,Test Auto-configuration Annotations>> | <<executable-jar.adoc#executable-jar,Executable Jars>> | <<dependency-versions.adoc#dependency-versions,Dependency Versions>> * *Appendix:* <<common-application-properties.adoc#appendix.common-application-properties,Application Properties>> | <<configuration-metadata.adoc#appendix.configuration-metadata,Configuration Metadata>> | <<auto-configuration-classes.adoc#appendix.auto-configuration-classes,Auto-configuration Classes>> | <<test-auto-configuration.adoc#appendix.test-auto-configuration,Test Auto-configuration Annotations>> | <<executable-jar.adoc#appendix.executable-jar,Executable Jars>> | <<dependency-versions.adoc#appendix.dependency-versions,Dependency Versions>>
[appendix] [appendix]
[[executable-jar]] [[appendix.executable-jar]]
= The Executable Jar Format = The Executable Jar Format
include::attributes.adoc[] include::attributes.adoc[]
...@@ -10,7 +10,7 @@ If you need to create executable jars from a different build system or if you ar ...@@ -10,7 +10,7 @@ If you need to create executable jars from a different build system or if you ar
[[executable-jar.nested-jars]] [[appendix.executable-jar.nested-jars]]
== Nested JARs == Nested JARs
Java does not provide any standard way to load nested jar files (that is, jar files that are themselves contained within a jar). Java does not provide any standard way to load nested jar files (that is, jar files that are themselves contained within a jar).
This can be problematic if you need to distribute a self-contained application that can be run from the command line without unpacking. This can be problematic if you need to distribute a self-contained application that can be run from the command line without unpacking.
...@@ -23,7 +23,7 @@ Spring Boot takes a different approach and lets you actually nest jars directly. ...@@ -23,7 +23,7 @@ Spring Boot takes a different approach and lets you actually nest jars directly.
[[executable-jar.nested-jars.jar-structure]] [[appendix.executable-jar.nested-jars.jar-structure]]
=== The Executable Jar File Structure === The Executable Jar File Structure
Spring Boot Loader-compatible jar files should be structured in the following way: Spring Boot Loader-compatible jar files should be structured in the following way:
...@@ -53,7 +53,7 @@ Dependencies should be placed in a nested `BOOT-INF/lib` directory. ...@@ -53,7 +53,7 @@ Dependencies should be placed in a nested `BOOT-INF/lib` directory.
[[executable-jar.nested-jars.war-structure]] [[appendix.executable-jar.nested-jars.war-structure]]
=== The Executable War File Structure === The Executable War File Structure
Spring Boot Loader-compatible war files should be structured in the following way: Spring Boot Loader-compatible war files should be structured in the following way:
...@@ -87,7 +87,7 @@ Any dependencies that are required when running embedded but are not required wh ...@@ -87,7 +87,7 @@ Any dependencies that are required when running embedded but are not required wh
[[executable-jar.nested-jars.index-files]] [[appendix.executable-jar.nested-jars.index-files]]
=== Index Files === Index Files
Spring Boot Loader-compatible jar and war archives can include additional index files under the `BOOT-INF/` directory. Spring Boot Loader-compatible jar and war archives can include additional index files under the `BOOT-INF/` directory.
A `classpath.idx` file can be provided for both jars and wars, and it provides the ordering that jars should be added to the classpath. A `classpath.idx` file can be provided for both jars and wars, and it provides the ordering that jars should be added to the classpath.
...@@ -98,7 +98,7 @@ These files, however, are _not_ parsed internally as YAML and they must be writt ...@@ -98,7 +98,7 @@ These files, however, are _not_ parsed internally as YAML and they must be writt
[[executable-jar.nested-jars.classpath-index]] [[appendix.executable-jar.nested-jars.classpath-index]]
=== Classpath Index === Classpath Index
The classpath index file can be provided in `BOOT-INF/classpath.idx`. The classpath index file can be provided in `BOOT-INF/classpath.idx`.
It provides a list of jar names (including the directory) in the order that they should be added to the classpath. It provides a list of jar names (including the directory) in the order that they should be added to the classpath.
...@@ -130,7 +130,7 @@ The index file would look like this: ...@@ -130,7 +130,7 @@ The index file would look like this:
[[executable-jar.nested-jars.layer-index]] [[appendix.executable-jar.nested-jars.layer-index]]
=== Layer Index === Layer Index
The layers index file can be provided in `BOOT-INF/layers.idx`. The layers index file can be provided in `BOOT-INF/layers.idx`.
It provides a list of layers and the parts of the jar that should be contained within them. It provides a list of layers and the parts of the jar that should be contained within them.
...@@ -154,7 +154,7 @@ A typical example of a layers index would be: ...@@ -154,7 +154,7 @@ A typical example of a layers index would be:
[[executable-jar.jarfile-class]] [[appendix.executable-jar.jarfile-class]]
== Spring Boot's "`JarFile`" Class == Spring Boot's "`JarFile`" Class
The core class used to support loading nested jars is `org.springframework.boot.loader.jar.JarFile`. The core class used to support loading nested jars is `org.springframework.boot.loader.jar.JarFile`.
It lets you load jar content from a standard jar file or from nested child jar data. It lets you load jar content from a standard jar file or from nested child jar data.
...@@ -181,7 +181,7 @@ We do not need to unpack the archive, and we do not need to read all entry data ...@@ -181,7 +181,7 @@ We do not need to unpack the archive, and we do not need to read all entry data
[[executable-jar.jarfile-class.compatibilty]] [[appendix.executable-jar.jarfile-class.compatibilty]]
=== Compatibility with the Standard Java "`JarFile`" === Compatibility with the Standard Java "`JarFile`"
Spring Boot Loader strives to remain compatible with existing code and libraries. Spring Boot Loader strives to remain compatible with existing code and libraries.
`org.springframework.boot.loader.jar.JarFile` extends from `java.util.jar.JarFile` and should work as a drop-in replacement. `org.springframework.boot.loader.jar.JarFile` extends from `java.util.jar.JarFile` and should work as a drop-in replacement.
...@@ -189,7 +189,7 @@ The `getURL()` method returns a `URL` that opens a connection compatible with `j ...@@ -189,7 +189,7 @@ The `getURL()` method returns a `URL` that opens a connection compatible with `j
[[executable-jar.launching]] [[appendix.executable-jar.launching]]
== Launching Executable Jars == Launching Executable Jars
The `org.springframework.boot.loader.Launcher` class is a special bootstrap class that is used as an executable jar's main entry point. The `org.springframework.boot.loader.Launcher` class is a special bootstrap class that is used as an executable jar's main entry point.
It is the actual `Main-Class` in your jar file, and it is used to setup an appropriate `URLClassLoader` and ultimately call your `main()` method. It is the actual `Main-Class` in your jar file, and it is used to setup an appropriate `URLClassLoader` and ultimately call your `main()` method.
...@@ -204,7 +204,7 @@ You can add additional locations by setting an environment variable called `LOAD ...@@ -204,7 +204,7 @@ You can add additional locations by setting an environment variable called `LOAD
[[executable-jar.launching.manifest]] [[appendix.executable-jar.launching.manifest]]
=== Launcher Manifest === Launcher Manifest
You need to specify an appropriate `Launcher` as the `Main-Class` attribute of `META-INF/MANIFEST.MF`. You need to specify an appropriate `Launcher` as the `Main-Class` attribute of `META-INF/MANIFEST.MF`.
The actual class that you want to launch (that is, the class that contains a `main` method) should be specified in the `Start-Class` attribute. The actual class that you want to launch (that is, the class that contains a `main` method) should be specified in the `Start-Class` attribute.
...@@ -230,7 +230,7 @@ The classpath is deduced from the nested jars. ...@@ -230,7 +230,7 @@ The classpath is deduced from the nested jars.
[[executable-jar.property-launcher]] [[appendix.executable-jar.property-launcher]]
== PropertiesLauncher Features == PropertiesLauncher Features
`PropertiesLauncher` has a few special features that can be enabled with external properties (System properties, environment variables, manifest entries, or `loader.properties`). `PropertiesLauncher` has a few special features that can be enabled with external properties (System properties, environment variables, manifest entries, or `loader.properties`).
The following table describes these properties: The following table describes these properties:
...@@ -314,13 +314,13 @@ The following rules apply to working with `PropertiesLauncher`: ...@@ -314,13 +314,13 @@ The following rules apply to working with `PropertiesLauncher`:
[[executable-jar.restrictions]] [[appendix.executable-jar.restrictions]]
== Executable Jar Restrictions == Executable Jar Restrictions
You need to consider the following restrictions when working with a Spring Boot Loader packaged application: You need to consider the following restrictions when working with a Spring Boot Loader packaged application:
[[executable-jar-zip-entry-compression]] [[appendix.executable-jar-zip-entry-compression]]
* Zip entry compression: * Zip entry compression:
The `ZipEntry` for a nested jar must be saved by using the `ZipEntry.STORED` method. The `ZipEntry` for a nested jar must be saved by using the `ZipEntry.STORED` method.
This is required so that we can seek directly to individual content within the nested jar. This is required so that we can seek directly to individual content within the nested jar.
...@@ -328,7 +328,7 @@ The content of the nested jar file itself can still be compressed, as can any ot ...@@ -328,7 +328,7 @@ The content of the nested jar file itself can still be compressed, as can any ot
[[executable-jar-system-classloader]] [[appendix.executable-jar-system-classloader]]
* System classLoader: * System classLoader:
Launched applications should use `Thread.getContextClassLoader()` when loading classes (most libraries and frameworks do so by default). Launched applications should use `Thread.getContextClassLoader()` when loading classes (most libraries and frameworks do so by default).
Trying to load nested jar classes with `ClassLoader.getSystemClassLoader()` fails. Trying to load nested jar classes with `ClassLoader.getSystemClassLoader()` fails.
...@@ -337,7 +337,7 @@ For this reason, you should consider a different logging implementation. ...@@ -337,7 +337,7 @@ For this reason, you should consider a different logging implementation.
[[executable-jar.alternatives]] [[appendix.executable-jar.alternatives]]
== Alternative Single Jar Solutions == Alternative Single Jar Solutions
If the preceding restrictions mean that you cannot use Spring Boot Loader, consider the following alternatives: If the preceding restrictions mean that you cannot use Spring Boot Loader, consider the following alternatives:
......
...@@ -252,7 +252,7 @@ NOTE: If you install the Spring Boot CLI by using Homebrew or MacPorts, the comm ...@@ -252,7 +252,7 @@ NOTE: If you install the Spring Boot CLI by using Homebrew or MacPorts, the comm
[[getting-started.installing.scoop]] [[getting-started.installing.cli.scoop]]
==== Windows Scoop Installation ==== Windows Scoop Installation
If you are on a Windows and use https://scoop.sh/[Scoop], you can install the Spring Boot CLI by using the following commands: If you are on a Windows and use https://scoop.sh/[Scoop], you can install the Spring Boot CLI by using the following commands:
...@@ -269,7 +269,7 @@ In that case, run `scoop update` and try again. ...@@ -269,7 +269,7 @@ In that case, run `scoop update` and try again.
[[getting-started.installing.quick-start]] [[getting-started.installing.cli.quick-start]]
==== Quick-start Spring CLI Example ==== Quick-start Spring CLI Example
You can use the following web application to test your installation. You can use the following web application to test your installation.
To start, create a file called `app.groovy`, as follows: To start, create a file called `app.groovy`, as follows:
...@@ -604,7 +604,7 @@ An uber jar packages all the classes from all the application's dependencies int ...@@ -604,7 +604,7 @@ An uber jar packages all the classes from all the application's dependencies int
The problem with this approach is that it becomes hard to see which libraries are in your application. The problem with this approach is that it becomes hard to see which libraries are in your application.
It can also be problematic if the same filename is used (but with different content) in multiple jars. It can also be problematic if the same filename is used (but with different content) in multiple jars.
Spring Boot takes a <<executable-jar.adoc#executable-jar, different approach>> and lets you actually nest jars directly. Spring Boot takes a <<executable-jar.adoc#appendix.executable-jar, different approach>> and lets you actually nest jars directly.
**** ****
To create an executable jar, we need to add the `spring-boot-maven-plugin` to our `pom.xml`. To create an executable jar, we need to add the `spring-boot-maven-plugin` to our `pom.xml`.
......
...@@ -402,7 +402,7 @@ There is not (and technically cannot be) an exhaustive list of all supported pro ...@@ -402,7 +402,7 @@ There is not (and technically cannot be) an exhaustive list of all supported pro
A running application with the Actuator features has a `configprops` endpoint that shows all the bound and bindable properties available through `@ConfigurationProperties`. A running application with the Actuator features has a `configprops` endpoint that shows all the bound and bindable properties available through `@ConfigurationProperties`.
The appendix includes an <<common-application-properties.adoc#common-application-properties, `application.properties`>> example with a list of the most common properties supported by Spring Boot. The appendix includes an <<common-application-properties.adoc#appendix.common-application-properties, `application.properties`>> example with a list of the most common properties supported by Spring Boot.
The definitive list comes from searching the source code for `@ConfigurationProperties` and `@Value` annotations as well as the occasional use of `Binder`. The definitive list comes from searching the source code for `@ConfigurationProperties` and `@Value` annotations as well as the occasional use of `Binder`.
For more about the exact ordering of loading properties, see "<<spring-boot-features#features.external-config>>". For more about the exact ordering of loading properties, see "<<spring-boot-features#features.external-config>>".
...@@ -656,7 +656,7 @@ As of Undertow 1.4.0+, both `h2` and `h2c` are supported on JDK 8 without any ad ...@@ -656,7 +656,7 @@ As of Undertow 1.4.0+, both `h2` and `h2c` are supported on JDK 8 without any ad
=== Configure the Web Server === Configure the Web Server
Generally, you should first consider using one of the many available configuration keys and customize your web server by adding new entries in your `application.properties` (or `application.yml`, or environment, etc. see "`<<howto.properties-and-configuration.discover-build-in-options-for-external-properties>>`"). Generally, you should first consider using one of the many available configuration keys and customize your web server by adding new entries in your `application.properties` (or `application.yml`, or environment, etc. see "`<<howto.properties-and-configuration.discover-build-in-options-for-external-properties>>`").
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. 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.
See the list of <<common-application-properties.adoc#common-application-properties>>. See the list of <<common-application-properties.adoc#appendix.common-application-properties>>.
The previous sections covered already many common use cases, such as compression, SSL or HTTP/2. 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`]. 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`].
...@@ -1076,11 +1076,11 @@ If you provide any `@Beans` of type `MappingJackson2HttpMessageConverter`, they ...@@ -1076,11 +1076,11 @@ If you provide any `@Beans` of type `MappingJackson2HttpMessageConverter`, they
Also, a convenience bean of type `HttpMessageConverters` is provided (and is always available if you use the default MVC configuration). Also, a convenience bean of type `HttpMessageConverters` is provided (and is always available if you use the default MVC configuration).
It has some useful methods to access the default and user-enhanced message converters. It has some useful methods to access the default and user-enhanced message converters.
See the "`<<howtospring-mvc.customize-responsebody-rendering>>`" section and the {spring-boot-autoconfigure-module-code}/web/servlet/WebMvcAutoConfiguration.java[`WebMvcAutoConfiguration`] source code for more details. See the "`<<howto.spring-mvc.customize-responsebody-rendering>>`" section and the {spring-boot-autoconfigure-module-code}/web/servlet/WebMvcAutoConfiguration.java[`WebMvcAutoConfiguration`] source code for more details.
[[howtospring-mvc.customize-responsebody-rendering]] [[howto.spring-mvc.customize-responsebody-rendering]]
=== Customize the @ResponseBody Rendering === Customize the @ResponseBody Rendering
Spring uses `HttpMessageConverters` to render `@ResponseBody` (or responses from `@RestController`). Spring uses `HttpMessageConverters` to render `@ResponseBody` (or responses from `@RestController`).
You can contribute additional converters by adding beans of the appropriate type in a Spring Boot context. You can contribute additional converters by adding beans of the appropriate type in a Spring Boot context.
...@@ -2578,7 +2578,7 @@ If your application contains classes that you want to share with other projects, ...@@ -2578,7 +2578,7 @@ If your application contains classes that you want to share with other projects,
The separate module can then be depended upon by your application and other projects. The separate module can then be depended upon by your application and other projects.
If you cannot rearrange your code as recommended above, Spring Boot's Maven and Gradle plugins must be configured to produce a separate artifact that is suitable for use as a dependency. If you cannot rearrange your code as recommended above, Spring Boot's Maven and Gradle plugins must be configured to produce a separate artifact that is suitable for use as a dependency.
The executable archive cannot be used as a dependency as the <<executable-jar.adoc#executable-jar.nested-jars.jar-structure,executable jar format>> packages application classes in `BOOT-INF/classes`. The executable archive cannot be used as a dependency as the <<executable-jar.adoc#appendix.executable-jar.nested-jars.jar-structure,executable jar format>> packages application classes in `BOOT-INF/classes`.
This means that they cannot be found when the executable jar is used as a dependency. This means that they cannot be found when the executable jar is used as a dependency.
To produce the two artifacts, one that can be used as a dependency and one that is executable, a classifier must be specified. To produce the two artifacts, one that can be used as a dependency and one that is executable, a classifier must be specified.
...@@ -2735,7 +2735,7 @@ This section answers common questions about traditional deployment. ...@@ -2735,7 +2735,7 @@ This section answers common questions about traditional deployment.
[[howto.howto.traditional-deployment.war]] [[howto.traditional-deployment.war]]
=== Create a Deployable War File === Create a Deployable War File
WARNING: Because Spring WebFlux does not strictly depend on the Servlet API and applications are deployed by default on an embedded Reactor Netty server, War deployment is not supported for WebFlux applications. WARNING: Because Spring WebFlux does not strictly depend on the Servlet API and applications are deployed by default on an embedded Reactor Netty server, War deployment is not supported for WebFlux applications.
...@@ -2813,7 +2813,7 @@ This means that, in addition to being deployable to a servlet container, you can ...@@ -2813,7 +2813,7 @@ This means that, in addition to being deployable to a servlet container, you can
[[howto.howto.traditional-deployment.convert-existing-application]] [[howto.traditional-deployment.convert-existing-application]]
=== Convert an Existing Application to Spring Boot === Convert an Existing Application to Spring Boot
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 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`.
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.
...@@ -2909,7 +2909,7 @@ In that case, we suggest https://stackoverflow.com/questions/tagged/spring-boot[ ...@@ -2909,7 +2909,7 @@ In that case, we suggest https://stackoverflow.com/questions/tagged/spring-boot[
[[howto.howto.traditional-deployment.weblogic]] [[howto.traditional-deployment.weblogic]]
=== Deploying a WAR to WebLogic === Deploying a WAR to WebLogic
To deploy a Spring Boot application to WebLogic, you must ensure that your servlet initializer *directly* implements `WebApplicationInitializer` (even if you extend from a base class that already implements it). To deploy a Spring Boot application to WebLogic, you must ensure that your servlet initializer *directly* implements `WebApplicationInitializer` (even if you extend from a base class that already implements it).
...@@ -2950,8 +2950,8 @@ You can do so by adding a `WEB-INF/weblogic.xml` file with the following content ...@@ -2950,8 +2950,8 @@ You can do so by adding a `WEB-INF/weblogic.xml` file with the following content
[[howto.howto.traditional-deployment.jedis-instead-of-lettuce]] [[howto.jedis-instead-of-lettuce]]
=== 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 both of these dependencies so you can switch to Jedis without specifying a version. Spring Boot manages both of these dependencies so you can switch to Jedis without specifying a version.
...@@ -2991,8 +2991,8 @@ The following example shows how to do so in Gradle: ...@@ -2991,8 +2991,8 @@ The following example shows how to do so in Gradle:
[[howto.howto.traditional-deployment.testcontainers]] [[howto.testcontainers]]
=== Use Testcontainers for integration testing == Use Testcontainers for integration testing
The https://www.testcontainers.org/[Testcontainers] library provides a way to manage services running inside Docker containers. The https://www.testcontainers.org/[Testcontainers] library provides a way to manage services running inside Docker containers.
It integrates with JUnit, allowing you to write a test class that can start up a container before any of the tests run. It integrates with JUnit, allowing you to write a test class that can start up a container before any of the tests run.
Testcontainers is especially useful for writing integration tests that talk to a real backend service such as MySQL, MongoDB, Cassandra etc. Testcontainers is especially useful for writing integration tests that talk to a real backend service such as MySQL, MongoDB, Cassandra etc.
......
...@@ -23,9 +23,9 @@ The reference documentation consists of the following sections: ...@@ -23,9 +23,9 @@ The reference documentation consists of the following sections:
The reference documentation has the following appendices: The reference documentation has the following appendices:
[horizontal] [horizontal]
<<common-application-properties.adoc#common-application-properties,Application Properties>> :: Common application properties that can be used to configure your application. <<common-application-properties.adoc#appendix.common-application-properties,Application Properties>> :: Common application properties that can be used to configure your application.
<<configuration-metadata.adoc#configuration-metadata,Configuration Metadata>> :: Metadata used to describe configuration properties. <<configuration-metadata.adoc#appendix.configuration-metadata,Configuration Metadata>> :: Metadata used to describe configuration properties.
<<auto-configuration-classes.adoc#auto-configuration-classes,Auto-configuration Classes>> :: Auto-configuration classes provided by Spring Boot. <<auto-configuration-classes.adoc#appendix.auto-configuration-classes,Auto-configuration Classes>> :: Auto-configuration classes provided by Spring Boot.
<<test-auto-configuration.adoc#test-auto-configuration,Test Auto-configuration Annotations>> :: Test-autoconfiguration annotations used to test slices of your application. <<test-auto-configuration.adoc#appendix.test-auto-configuration,Test Auto-configuration Annotations>> :: Test-autoconfiguration annotations used to test slices of your application.
<<executable-jar.adoc#executable-jar,Executable Jars>> :: Spring Boot's executable jars, their launchers, and their format. <<executable-jar.adoc#appendix.executable-jar,Executable Jars>> :: Spring Boot's executable jars, their launchers, and their format.
<<dependency-versions.adoc#dependency-versions,Dependency Versions>> :: Details of the dependencies that are managed by Spring Boot. <<dependency-versions.adoc#appendix.dependency-versions,Dependency Versions>> :: Details of the dependencies that are managed by Spring Boot.
[appendix] [appendix]
[[test-auto-configuration]] [[appendix.test-auto-configuration]]
= Test Auto-configuration Annotations = Test Auto-configuration Annotations
include::attributes.adoc[] include::attributes.adoc[]
...@@ -7,7 +7,7 @@ This appendix describes the `@…Test` auto-configuration annotations that Sprin ...@@ -7,7 +7,7 @@ This appendix describes the `@…Test` auto-configuration annotations that Sprin
[[test-auto-configuration.slices]] [[appendix.test-auto-configuration.slices]]
== Test Slices == Test Slices
The following table lists the various `@…Test` annotations that can be used to test slices of your application and the auto-configuration that they import by default: The following table lists the various `@…Test` annotations that can be used to test slices of your application and the auto-configuration that they import by default:
......
...@@ -148,10 +148,11 @@ bom { ...@@ -148,10 +148,11 @@ bom {
] ]
} }
} }
library("Spring Asciidoctor Extensions", "0.5.1") { library("Spring Asciidoctor Extensions", "0.6.0-SNAPSHOT") {
group("io.spring.asciidoctor") { group("io.spring.asciidoctor") {
modules = [ modules = [
"spring-asciidoctor-extensions-spring-boot" "spring-asciidoctor-extensions-spring-boot",
"spring-asciidoctor-extensions-section-ids"
] ]
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment