Commit bd3f4d74 authored by Phillip Webb's avatar Phillip Webb

Rationalize reference documentation anchors

Closes gh-26296
parent 3d9eb9e4
...@@ -7,103 +7,103 @@ include::attributes.adoc[] ...@@ -7,103 +7,103 @@ include::attributes.adoc[]
Various properties can be specified inside your `application.properties` file, inside your `application.yml` file, or as command line switches. Various properties can be specified inside your `application.properties` file, inside your `application.yml` file, or as command line switches.
This appendix provides a list of common Spring Boot properties and references to the underlying classes that consume them. This appendix provides a list of common Spring Boot properties and references to the underlying classes that consume them.
TIP: Spring Boot provides various conversion mechanism with advanced value formatting, make sure to review <<spring-boot-features.adoc#boot-features-external-config-conversion, the properties conversion section>>. TIP: Spring Boot provides various conversion mechanism with advanced value formatting, make sure to review <<spring-boot-features.adoc#features.external-config.typesafe-configuration-properties.conversion, the properties conversion section>>.
NOTE: Property contributions can come from additional jar files on your classpath, so you should not consider this an exhaustive list. NOTE: Property contributions can come from additional jar files on your classpath, so you should not consider this an exhaustive list.
Also, you can define your own properties. Also, you can define your own properties.
[[common-application-properties-core]] [[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]] [[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]] [[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]] [[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]] [[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]] [[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]] [[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]] [[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]] [[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]] [[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]] [[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]] [[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]] [[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]] [[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]] [[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]] [[common-application-properties.testing]]
== Testing Properties [[testing-properties]] == Testing Properties [[testing-properties]]
include::config-docs/testing.adoc[] include::config-docs/testing.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-from-autoconfigure-module]] [[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-from-actuator]] [[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:
......
...@@ -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]] [[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::dependency-versions.adoc[] ...@@ -17,7 +17,7 @@ include::dependency-versions.adoc[]
[[dependency-versions-properties]] [[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.
......
...@@ -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]] [[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-jar-file-structure]] [[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-war-file-structure]] [[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-war-index-files]] [[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-war-index-files-classpath]] [[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-war-index-files-layers]] [[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]] [[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-compatibility]] [[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]] [[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-launcher-manifest]] [[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-features]] [[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,7 +314,7 @@ The following rules apply to working with `PropertiesLauncher`: ...@@ -314,7 +314,7 @@ The following rules apply to working with `PropertiesLauncher`:
[[executable-jar-restrictions]] [[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:
...@@ -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]] [[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:
......
...@@ -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]] [[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:
......
...@@ -5,11 +5,11 @@ include::attributes.adoc[] ...@@ -5,11 +5,11 @@ include::attributes.adoc[]
Spring Boot provides build tool plugins for Maven and Gradle. Spring Boot provides build tool plugins for Maven and Gradle.
The plugins offer a variety of features, including the packaging of executable jars. The plugins offer a variety of features, including the packaging of executable jars.
This section provides more details on both plugins as well as some help should you need to extend an unsupported build system. This section provides more details on both plugins as well as some help should you need to extend an unsupported build system.
If you are just getting started, you might want to read "`<<using-spring-boot.adoc#using-boot-build-systems>>`" from the "`<<using-spring-boot.adoc#using-boot>>`" section first. If you are just getting started, you might want to read "`<<using-spring-boot.adoc#using.build-systems>>`" from the "`<<using-spring-boot.adoc#using>>`" section first.
[[build-tool-plugins-maven-plugin]] [[build-tool-plugins.maven]]
== Spring Boot Maven Plugin == Spring Boot Maven Plugin
The Spring Boot Maven Plugin provides Spring Boot support in Maven, letting you package executable jar or war archives and run an application "`in-place`". The Spring Boot Maven Plugin provides Spring Boot support in Maven, letting you package executable jar or war archives and run an application "`in-place`".
To use it, you must use Maven 3.2 (or later). To use it, you must use Maven 3.2 (or later).
...@@ -21,7 +21,7 @@ Please refer to the plugin's documentation to learn more: ...@@ -21,7 +21,7 @@ Please refer to the plugin's documentation to learn more:
[[build-tool-plugins-gradle-plugin]] [[build-tool-plugins.gradle]]
== Spring Boot Gradle Plugin == Spring Boot Gradle Plugin
The Spring Boot Gradle Plugin provides Spring Boot support in Gradle, letting you package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`. The Spring Boot Gradle Plugin provides Spring Boot support in Gradle, letting you package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`.
It requires Gradle 6.8 or 7.x. It requires Gradle 6.8 or 7.x.
...@@ -32,7 +32,7 @@ Please refer to the plugin's documentation to learn more: ...@@ -32,7 +32,7 @@ Please refer to the plugin's documentation to learn more:
[[build-tool-plugins-antlib]] [[build-tool-plugins.antlib]]
== Spring Boot AntLib Module == Spring Boot AntLib Module
The Spring Boot AntLib module provides basic Spring Boot support for Apache Ant. The Spring Boot AntLib module provides basic Spring Boot support for Apache Ant.
You can use the module to create executable jars. You can use the module to create executable jars.
...@@ -54,20 +54,20 @@ You need to remember to start Ant using the `-lib` option, as shown in the follo ...@@ -54,20 +54,20 @@ You need to remember to start Ant using the `-lib` option, as shown in the follo
$ ant -lib <directory containing spring-boot-antlib-{spring-boot-version}.jar> $ ant -lib <directory containing spring-boot-antlib-{spring-boot-version}.jar>
---- ----
TIP: The "`Using Spring Boot`" section includes a more complete example of <<using-spring-boot.adoc#using-boot-ant, using Apache Ant with `spring-boot-antlib`>>. TIP: The "`Using Spring Boot`" section includes a more complete example of <<using-spring-boot.adoc#using.build-systems.ant, using Apache Ant with `spring-boot-antlib`>>.
[[spring-boot-ant-tasks]] [[build-tool-plugins.antlib.tasks]]
=== Spring Boot Ant Tasks === Spring Boot Ant Tasks
Once the `spring-boot-antlib` namespace has been declared, the following additional tasks are available: Once the `spring-boot-antlib` namespace has been declared, the following additional tasks are available:
* <<spring-boot-ant-exejar>> * <<build-tool-plugins.antlib.tasks.exejar>>
* <<spring-boot-ant-findmainclass>> * <<build-tool-plugins.antlib.findmainclass>>
[[spring-boot-ant-exejar]] [[build-tool-plugins.antlib.tasks.exejar]]
==== Using the "`exejar`" Task ==== Using the "`exejar`" Task
You can use the `exejar` task to create a Spring Boot executable jar. You can use the `exejar` task to create a Spring Boot executable jar.
The following attributes are supported by the task: The following attributes are supported by the task:
...@@ -104,7 +104,7 @@ The following nested elements can be used with the task: ...@@ -104,7 +104,7 @@ The following nested elements can be used with the task:
[[spring-boot-ant-exejar-examples]] [[build-tool-plugins.antlib.tasks.examples]]
==== Examples ==== Examples
This section shows two examples of Ant tasks. This section shows two examples of Ant tasks.
...@@ -134,7 +134,7 @@ This section shows two examples of Ant tasks. ...@@ -134,7 +134,7 @@ This section shows two examples of Ant tasks.
[[spring-boot-ant-findmainclass]] [[build-tool-plugins.antlib.findmainclass]]
=== Using the "`findmainclass`" Task === Using the "`findmainclass`" Task
The `findmainclass` task is used internally by `exejar` to locate a class declaring a `main`. The `findmainclass` task is used internally by `exejar` to locate a class declaring a `main`.
If necessary, you can also use this task directly in your build. If necessary, you can also use this task directly in your build.
...@@ -159,7 +159,7 @@ The following attributes are supported: ...@@ -159,7 +159,7 @@ The following attributes are supported:
[[spring-boot-ant-findmainclass-examples]] [[build-tool-plugins.antlib.findmainclass.examples]]
==== Examples ==== Examples
This section contains three examples of using `findmainclass`. This section contains three examples of using `findmainclass`.
...@@ -183,7 +183,7 @@ This section contains three examples of using `findmainclass`. ...@@ -183,7 +183,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 "`<<appendix-executable-jar-format.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 "`<<appendix-executable-jar-format.adoc#executable-jar, executable jar format>>`" section in the appendix for details).
...@@ -193,7 +193,7 @@ If you need to, you may use this library directly. ...@@ -193,7 +193,7 @@ If you need to, you may use this library directly.
[[build-tool-plugins-repackaging-archives]] [[build-tool-plugins.other-build-systems.repackaging-archives]]
=== Repackaging Archives === Repackaging Archives
To repackage an existing archive so that it becomes a self-contained executable archive, use `org.springframework.boot.loader.tools.Repackager`. To repackage an existing archive so that it becomes a self-contained executable archive, use `org.springframework.boot.loader.tools.Repackager`.
The `Repackager` class takes a single constructor argument that refers to an existing jar or war archive. The `Repackager` class takes a single constructor argument that refers to an existing jar or war archive.
...@@ -202,7 +202,7 @@ Various settings can also be configured on the repackager before it is run. ...@@ -202,7 +202,7 @@ Various settings can also be configured on the repackager before it is run.
[[build-tool-plugins-nested-libraries]] [[build-tool-plugins.other-build-systems.nested-libraries]]
=== Nested Libraries === Nested Libraries
When repackaging an archive, you can include references to dependency files by using the `org.springframework.boot.loader.tools.Libraries` interface. When repackaging an archive, you can include references to dependency files by using the `org.springframework.boot.loader.tools.Libraries` interface.
We do not provide any concrete implementations of `Libraries` here as they are usually build-system-specific. We do not provide any concrete implementations of `Libraries` here as they are usually build-system-specific.
...@@ -211,14 +211,14 @@ If your archive already includes libraries, you can use `Libraries.NONE`. ...@@ -211,14 +211,14 @@ If your archive already includes libraries, you can use `Libraries.NONE`.
[[build-tool-plugins-find-a-main-class]] [[build-tool-plugins.other-build-systems.finding-main-class]]
=== Finding a Main Class === Finding a Main Class
If you do not use `Repackager.setMainClass()` to specify a main class, the repackager uses https://asm.ow2.io/[ASM] to read class files and tries to find a suitable class with a `public static void main(String[] args)` method. If you do not use `Repackager.setMainClass()` to specify a main class, the repackager uses https://asm.ow2.io/[ASM] to read class files and tries to find a suitable class with a `public static void main(String[] args)` method.
An exception is thrown if more than one candidate is found. An exception is thrown if more than one candidate is found.
[[build-tool-plugins-repackage-implementation]] [[build-tool-plugins.other-build-systems.example-repackage-implementation]]
=== Example Repackage Implementation === Example Repackage Implementation
The following example shows a typical repackage implementation: The following example shows a typical repackage implementation:
...@@ -237,7 +237,7 @@ The following example shows a typical repackage implementation: ...@@ -237,7 +237,7 @@ 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#executable-jar,the appendix>>.
......
[[spring-boot-reference-documentation]] [[index]]
= Spring Boot Reference Documentation = Spring Boot Reference Documentation
include::authors.adoc[] include::authors.adoc[]
:docinfo: shared :docinfo: shared
...@@ -10,11 +10,11 @@ The reference documentation consists of the following sections: ...@@ -10,11 +10,11 @@ The reference documentation consists of the following sections:
[horizontal] [horizontal]
<<legal.adoc#legal,Legal>> :: Legal information. <<legal.adoc#legal,Legal>> :: Legal information.
<<documentation-overview.adoc#boot-documentation,Documentation Overview>> :: About the Documentation, Getting Help, First Steps, and more. <<documentation-overview.adoc#documentation,Documentation Overview>> :: About the Documentation, Getting Help, First Steps, and more.
<<getting-started.adoc#getting-started,Getting Started>> :: Introducing Spring Boot, System Requirements, Servlet Containers, Installing Spring Boot, Developing Your First Spring Boot Application <<getting-started.adoc#getting-started,Getting Started>> :: Introducing Spring Boot, System Requirements, Servlet Containers, Installing Spring Boot, Developing Your First Spring Boot Application
<<using-spring-boot.adoc#using-boot,Using Spring Boot>> :: Build Systems, Structuring Your Code, Configuration, Spring Beans and Dependency Injection, DevTools, and more. <<using-spring-boot.adoc#using,Using Spring Boot>> :: Build Systems, Structuring Your Code, Configuration, Spring Beans and Dependency Injection, DevTools, and more.
<<spring-boot-features.adoc#boot-features,Spring Boot Features>> :: Profiles, Logging, Security, Caching, Spring Integration, Testing, and more. <<spring-boot-features.adoc#features,Spring Boot Features>> :: Profiles, Logging, Security, Caching, Spring Integration, Testing, and more.
<<production-ready-features.adoc#production-ready,Spring Boot Actuator>> :: Monitoring, Metrics, Auditing, and more. <<production-ready-features.adoc#actuator,Spring Boot Actuator>> :: Monitoring, Metrics, Auditing, and more.
<<deployment.adoc#deployment,Deploying Spring Boot Applications>> :: Deploying to the Cloud, Installing as a Unix application. <<deployment.adoc#deployment,Deploying Spring Boot Applications>> :: Deploying to the Cloud, Installing as a Unix application.
<<spring-boot-cli.adoc#cli,Spring Boot CLI>> :: Installing the CLI, Using the CLI, Configuring the CLI, and more. <<spring-boot-cli.adoc#cli,Spring Boot CLI>> :: Installing the CLI, Using the CLI, Configuring the CLI, and more.
<<build-tool-plugins.adoc#build-tool-plugins,Build Tool Plugins>> :: Maven Plugin, Gradle Plugin, Antlib, and more. <<build-tool-plugins.adoc#build-tool-plugins,Build Tool Plugins>> :: Maven Plugin, Gradle Plugin, Antlib, and more.
......
...@@ -8,14 +8,14 @@ You can also bootstrap a new project or write your own command for it. ...@@ -8,14 +8,14 @@ You can also bootstrap a new project or write your own command for it.
[[cli-installation]] [[cli.installation]]
== Installing the CLI == Installing the CLI
The Spring Boot CLI (Command-Line Interface) can be installed manually by using SDKMAN! (the SDK Manager) or by using Homebrew or MacPorts if you are an OSX user. The Spring Boot CLI (Command-Line Interface) can be installed manually by using SDKMAN! (the SDK Manager) or by using Homebrew or MacPorts if you are an OSX user.
See _<<getting-started.adoc#getting-started-installing-the-cli>>_ in the "`Getting started`" section for comprehensive installation instructions. See _<<getting-started.adoc#getting-started.installing.cli>>_ in the "`Getting started`" section for comprehensive installation instructions.
[[cli-using-the-cli]] [[cli.using-the-cli]]
== Using the CLI == Using the CLI
Once you have installed the CLI, you can run it by typing `spring` and pressing Enter at the command line. Once you have installed the CLI, you can run it by typing `spring` and pressing Enter at the command line.
If you run `spring` without any arguments, a help screen is displayed, as follows: If you run `spring` without any arguments, a help screen is displayed, as follows:
...@@ -66,7 +66,7 @@ The `version` command provides a quick way to check which version of Spring Boot ...@@ -66,7 +66,7 @@ The `version` command provides a quick way to check which version of Spring Boot
[[cli-run]] [[cli.using-the-cli.run]]
=== Running Applications with the CLI === Running Applications with the CLI
You can compile and run Groovy source code by using the `run` command. You can compile and run Groovy source code by using the `run` command.
The Spring Boot CLI is completely self-contained, so you do not need any external Groovy installation. The Spring Boot CLI is completely self-contained, so you do not need any external Groovy installation.
...@@ -113,7 +113,7 @@ Doing so ensures the values are properly passed to the process. ...@@ -113,7 +113,7 @@ Doing so ensures the values are properly passed to the process.
[[cli-deduced-grab-annotations]] [[cli.using-the-cli.run.deduced-grab-annotations]]
==== Deduced "`grab`" Dependencies ==== Deduced "`grab`" Dependencies
Standard Groovy includes a `@Grab` annotation, which lets you declare dependencies on third-party libraries. Standard Groovy includes a `@Grab` annotation, which lets you declare dependencies on third-party libraries.
This useful technique lets Groovy download jars in the same way as Maven or Gradle would but without requiring you to use a build tool. This useful technique lets Groovy download jars in the same way as Maven or Gradle would but without requiring you to use a build tool.
...@@ -164,7 +164,7 @@ TIP: See subclasses of {spring-boot-cli-module-code}/compiler/CompilerAutoConfig ...@@ -164,7 +164,7 @@ TIP: See subclasses of {spring-boot-cli-module-code}/compiler/CompilerAutoConfig
[[cli-default-grab-deduced-coordinates]] [[cli.using-the-cli.run.deduced-grab-coordinates]]
==== Deduced "`grab`" Coordinates ==== Deduced "`grab`" Coordinates
Spring Boot extends Groovy's standard `@Grab` support by letting you specify a dependency without a group or version (for example, `@Grab('freemarker')`). Spring Boot extends Groovy's standard `@Grab` support by letting you specify a dependency without a group or version (for example, `@Grab('freemarker')`).
Doing so consults Spring Boot's default dependency metadata to deduce the artifact's group and version. Doing so consults Spring Boot's default dependency metadata to deduce the artifact's group and version.
...@@ -175,7 +175,7 @@ A table showing the dependencies and their versions that are included in the def ...@@ -175,7 +175,7 @@ A table showing the dependencies and their versions that are included in the def
[[cli-default-import-statements]] [[cli.using-the-cli.run.default-import-statements]]
==== Default Import Statements ==== Default Import Statements
To help reduce the size of your Groovy code, several `import` statements are automatically included. To help reduce the size of your Groovy code, several `import` statements are automatically included.
Notice how the preceding example refers to `@Component`, `@RestController`, and `@RequestMapping` without needing to use fully-qualified names or `import` statements. Notice how the preceding example refers to `@Component`, `@RestController`, and `@RequestMapping` without needing to use fully-qualified names or `import` statements.
...@@ -185,14 +185,14 @@ Try running your application to see what fails before adding imports. ...@@ -185,14 +185,14 @@ Try running your application to see what fails before adding imports.
[[cli-automatic-main-method]] [[cli.using-the-cli.run.automatic-main-method]]
==== Automatic Main Method ==== Automatic Main Method
Unlike the equivalent Java application, you do not need to include a `public static void main(String[] args)` method with your `Groovy` scripts. Unlike the equivalent Java application, you do not need to include a `public static void main(String[] args)` method with your `Groovy` scripts.
A `SpringApplication` is automatically created, with your compiled code acting as the `source`. A `SpringApplication` is automatically created, with your compiled code acting as the `source`.
[[cli-default-grab-deduced-coordinates-custom-dependency-management]] [[cli.using-the-cli.run.custom-dependency-management]]
==== Custom Dependency Management ==== Custom Dependency Management
By default, the CLI uses the dependency management declared in `spring-boot-dependencies` when resolving `@Grab` dependencies. By default, the CLI uses the dependency management declared in `spring-boot-dependencies` when resolving `@Grab` dependencies.
Additional dependency management, which overrides the default dependency management, can be configured by using the `@DependencyManagementBom` annotation. Additional dependency management, which overrides the default dependency management, can be configured by using the `@DependencyManagementBom` annotation.
...@@ -222,7 +222,7 @@ However, to ensure consistent ordering of the dependency management, you can use ...@@ -222,7 +222,7 @@ However, to ensure consistent ordering of the dependency management, you can use
[[cli-multiple-source-files]] [[cli.using-the-cli.multiple-source-files]]
=== Applications with Multiple Source Files === Applications with Multiple Source Files
You can use "`shell globbing`" with all commands that accept file input. You can use "`shell globbing`" with all commands that accept file input.
Doing so lets you use multiple files from a single directory, as shown in the following example: Doing so lets you use multiple files from a single directory, as shown in the following example:
...@@ -234,7 +234,7 @@ Doing so lets you use multiple files from a single directory, as shown in the fo ...@@ -234,7 +234,7 @@ Doing so lets you use multiple files from a single directory, as shown in the fo
[[cli-jar]] [[cli.using-the-cli.packaging]]
=== Packaging Your Application === Packaging Your Application
You can use the `jar` command to package your application into a self-contained executable jar file, as shown in the following example: You can use the `jar` command to package your application into a self-contained executable jar file, as shown in the following example:
...@@ -265,7 +265,7 @@ Type `spring help jar` on the command line for more information. ...@@ -265,7 +265,7 @@ Type `spring help jar` on the command line for more information.
[[cli-init]] [[cli.using-the-cli.initialize-new-project]]
=== Initialize a New Project === Initialize a New Project
The `init` command lets you create a new project by using https://start.spring.io without leaving the shell, as shown in the following example: The `init` command lets you create a new project by using https://start.spring.io without leaving the shell, as shown in the following example:
...@@ -317,7 +317,7 @@ For instance, the following command creates a Gradle project that uses Java 8 an ...@@ -317,7 +317,7 @@ For instance, the following command creates a Gradle project that uses Java 8 an
[[cli-shell]] [[cli.using-the-cli.embedded-shell]]
=== Using the Embedded Shell === Using the Embedded Shell
Spring Boot includes command-line completion scripts for the BASH and zsh shells. Spring Boot includes command-line completion scripts for the BASH and zsh shells.
If you do not use either of these shells (perhaps you are a Windows user), you can use the `shell` command to launch an integrated shell, as shown in the following example: If you do not use either of these shells (perhaps you are a Windows user), you can use the `shell` command to launch an integrated shell, as shown in the following example:
...@@ -343,7 +343,7 @@ To exit the embedded shell, press `ctrl-c`. ...@@ -343,7 +343,7 @@ To exit the embedded shell, press `ctrl-c`.
[[cli-install-uninstall]] [[cli.using-the-cli.extensions]]
=== Adding Extensions to the CLI === Adding Extensions to the CLI
You can add extensions to the CLI by using the `install` command. You can add extensions to the CLI by using the `install` command.
The command takes one or more sets of artifact coordinates in the format `group:artifact:version`, as shown in the following example: The command takes one or more sets of artifact coordinates in the format `group:artifact:version`, as shown in the following example:
...@@ -374,7 +374,7 @@ To uninstall all additional dependencies, you can use the `--all` option, as sho ...@@ -374,7 +374,7 @@ To uninstall all additional dependencies, you can use the `--all` option, as sho
[[cli-groovy-beans-dsl]] [[cli.groovy-beans-dsl]]
== Developing Applications with the Groovy Beans DSL == Developing Applications with the Groovy Beans DSL
Spring Framework 4.0 has native support for a `beans{}` "`DSL`" (borrowed from https://grails.org/[Grails]), and you can embed bean definitions in your Groovy application scripts by using the same format. Spring Framework 4.0 has native support for a `beans{}` "`DSL`" (borrowed from https://grails.org/[Grails]), and you can embed bean definitions in your Groovy application scripts by using the same format.
This is sometimes a good way to include external features like middleware declarations, as shown in the following example: This is sometimes a good way to include external features like middleware declarations, as shown in the following example:
...@@ -407,7 +407,7 @@ You can mix class declarations with `beans{}` in the same file as long as they s ...@@ -407,7 +407,7 @@ You can mix class declarations with `beans{}` in the same file as long as they s
[[cli-maven-settings]] [[cli.maven-setting]]
== Configuring the CLI with settings.xml == Configuring the CLI with settings.xml
The Spring Boot CLI uses Aether, Maven's dependency resolution engine, to resolve dependencies. The Spring Boot CLI uses Aether, Maven's dependency resolution engine, to resolve dependencies.
The CLI makes use of the Maven configuration found in `~/.m2/settings.xml` to configure Aether. The CLI makes use of the Maven configuration found in `~/.m2/settings.xml` to configure Aether.
...@@ -426,7 +426,7 @@ See https://maven.apache.org/settings.html[Maven's settings documentation] for f ...@@ -426,7 +426,7 @@ See https://maven.apache.org/settings.html[Maven's settings documentation] for f
[[cli-whats-next]] [[cli.whats-next]]
== What to Read Next == What to Read Next
There are some {spring-boot-code}/spring-boot-project/spring-boot-cli/samples[sample groovy scripts] available from the GitHub repository that you can use to try out the Spring Boot CLI. There are some {spring-boot-code}/spring-boot-project/spring-boot-cli/samples[sample groovy scripts] available from the GitHub repository that you can use to try out the Spring Boot CLI.
There is also extensive Javadoc throughout the {spring-boot-cli-module-code}[source code]. There is also extensive Javadoc throughout the {spring-boot-cli-module-code}[source code].
......
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