Polish asciidoc formatting and use sentence case

pull/20874/head
Phillip Webb 5 years ago
parent 951a3e78f9
commit 6e7b473fef

@ -1,6 +1,5 @@
[[getting-started]]
== Getting started
== Getting Started
To get started with the plugin it needs to be applied to your project.
ifeval::["{version-type}" == "RELEASE"]

@ -38,7 +38,6 @@ Andy Wilkinson, Scott Frederick
[[introduction]]
== Introduction
The Spring Boot Gradle Plugin provides Spring Boot support in https://gradle.org[Gradle].
It allows you to package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`.
Spring Boot's Gradle plugin requires Gradle 6 (6.3 or later).

@ -3,8 +3,7 @@
[[integrating-with-actuator-build-info]]
=== Generating build information
=== Generating Build Information
Spring Boot Actuator's `info` endpoint automatically publishes information about your build in the presence of a `META-INF/build-info.properties` file.
A {build-info-javadoc}[`BuildInfo`] task is provided to generate this file.
The easiest way to use the task is via the plugin's DSL:

@ -1,6 +1,5 @@
[[managing-dependencies]]
== Managing dependencies
== Managing Dependencies
When you apply the {dependency-management-plugin}[`io.spring.dependency-management`] plugin, Spring Boot's plugin will automatically <<reacting-to-other-plugins-dependency-management,import the `spring-boot-dependencies` bom>> from the version of Spring Boot that you are using.
This provides a similar dependency management experience to the one that's enjoyed by Maven users.
For example, it allows you to omit version numbers when declaring dependencies that are managed in the bom.
@ -20,8 +19,7 @@ include::../gradle/managing-dependencies/dependencies.gradle.kts[tags=dependenci
[[managing-dependencies-customizing]]
=== Customizing managed versions
=== Customizing Managed Versions
The `spring-boot-dependencies` bom that is automatically imported when the dependency management plugin is applied uses properties to control the versions of the dependencies that it manages.
Browse the {version-properties-appendix}[`Dependency versions Appendix`] in the Spring Boot reference for a complete list of these properties.
@ -123,6 +121,5 @@ include::../gradle/managing-dependencies/configure-bom-with-plugins.gradle.kts[t
[[managing-dependencies-learning-more]]
=== Learning more
=== Learning More
To learn more about the capabilities of the dependency management plugin, please refer to its {dependency-management-plugin-documentation}[documentation].

@ -1,5 +1,5 @@
[[build-image]]
== Packaging OCI images
== Packaging OCI Images
The plugin can create an https://github.com/opencontainers/image-spec[OCI image] from executable jars using https://buildpacks.io[Cloud Native Buildpacks].
Images can be built using the `bootBuildImage` task.
The task is automatically created when the `java` plugin is applied and is an instance of {boot-build-image-javadoc}[`BootBuildImage`].
@ -7,7 +7,7 @@ The task is automatically created when the `java` plugin is applied and is an in
[[build-image-docker-daemon]]
=== Docker daemon
=== Docker Daemon
The `bootBuildImage` task requires access to a Docker daemon.
By default, it will communicate with a Docker daemon over a local connection.
This works with https://docs.docker.com/install/[Docker Engine] on all supported platforms without configuration.
@ -33,7 +33,7 @@ On Linux and macOS, these environment variables can be set using the command `ev
[[build-image-customization]]
=== Image customizations
=== Image Customizations
The plugin invokes a {buildpacks-reference}/concepts/components/builder/[builder] to orchestrate the generation of an image.
The builder includes multiple {buildpacks-reference}/concepts/components/buildpack[buildpacks] that can inspect the application to influence the generated image.
By default, the plugin chooses a builder image.
@ -79,7 +79,7 @@ The following table summarizes the available properties and their default values
[[build-image-example-custom-image-builder]]
==== Custom image builder
==== Custom Image Builder
If you need to customize the builder used to create the image, configure the task as shown in the following example:
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
@ -99,8 +99,7 @@ This configuration will use a builder image with the name `mine/java-cnb-builder
[[build-image-example-builder-configuration]]
==== Builder configuration
==== Builder Configuration
If the builder exposes configuration options, those can be set using the `environment` property.
The following example assumes that the default builder defines a `BP_JAVA_VERSION` property (typically used to customize the JDK version the image should use):
@ -135,7 +134,7 @@ include::../gradle/packaging/boot-build-image-env-proxy.gradle.kts[tags=env]
[[build-image-example-custom-image-name]]
==== Custom image name
==== Custom Image Name
By default, the image name is inferred from the `artifactId` and the `version` of the project, something like `docker.io/library/${project.artifactId}:${project.version}`.
You can take control over the name by setting task properties, as shown in the following example:

@ -1,11 +1,11 @@
[[packaging-executable]]
== Packaging executable archives
== Packaging Executable Archives
The plugin can create executable archives (jar files and war files) that contain all of an application's dependencies and can then be run with `java -jar`.
[[packaging-executable-jars]]
=== Packaging executable jars
=== Packaging Executable Jars
Executable jars can be built using the `bootJar` task.
The task is automatically created when the `java` plugin is applied and is an instance of {boot-jar-javadoc}[`BootJar`].
The `assemble` task is automatically configured to depend upon the `bootJar` task so running `assemble` (or `build`) will also run the `bootJar` task.
@ -13,7 +13,7 @@ The `assemble` task is automatically configured to depend upon the `bootJar` tas
[[packaging-executable-wars]]
=== Packaging executable wars
=== Packaging Executable Wars
Executable wars can be built using the `bootWar` task.
The task is automatically created when the `war` plugin is applied and is an instance of {boot-war-javadoc}[`BootWar`].
The `assemble` task is automatically configured to depend upon the `bootWar` task so running `assemble` (or `build`) will also run the `bootWar` task.
@ -21,7 +21,7 @@ The `assemble` task is automatically configured to depend upon the `bootWar` tas
[[packaging-executable-wars-deployable]]
==== Packaging executable and deployable wars
==== Packaging Executable and Deployable Wars
A war file can be packaged such that it can be executed using `java -jar` and deployed to an external container.
To do so, the embedded servlet container dependencies should be added to the `providedRuntime` configuration, for example:
@ -45,7 +45,7 @@ NOTE: `providedRuntime` is preferred to Gradle's `compileOnly` configuration as,
[[packaging-executable-and-normal]]
=== Packaging executable and normal archives
=== Packaging Executable and Normal Archives
By default, when the `bootJar` or `bootWar` tasks are configured, the `jar` or `war` tasks are disabled.
A project can be configured to build both an executable archive and a normal archive at the same time by enabling the `jar` or `war` task:
@ -78,15 +78,17 @@ include::../gradle/packaging/boot-jar-and-jar.gradle.kts[tags=classifier]
----
[[packaging-executable-configuring]]
=== Configuring executable archive packaging
=== Configuring Executable Archive Packaging
The {boot-jar-javadoc}[`BootJar`] and {boot-war-javadoc}[`BootWar`] tasks are subclasses of Gradle's `Jar` and `War` tasks respectively.
As a result, all of the standard configuration options that are available when packaging a jar or war are also available when packaging an executable jar or war.
A number of configuration options that are specific to executable jars and wars are also provided.
[[packaging-executable-configuring-main-class]]
==== Configuring the main class
==== Configuring the Main Class
By default, the executable archive's main class will be configured automatically by looking for a class with a `public static void main(String[])` method in directories on the task's classpath.
The main class can also be configured explicitly using the task's `mainClassName` property:
@ -167,7 +169,7 @@ include::../gradle/packaging/boot-war-include-devtools.gradle.kts[tags=include-d
[[packaging-executable-configuring-unpacking]]
==== Configuring libraries that require unpacking
==== Configuring Libraries that Require Unpacking
Most libraries can be used directly when nested in an executable archive, however certain libraries can have problems.
For example, JRuby includes its own nested jar support which assumes that `jruby-complete.jar` is always directly available on the file system.
@ -193,7 +195,7 @@ The closure is passed a `FileTreeElement` and should return a `boolean` indicati
[[packaging-executable-configuring-launch-script]]
==== Making an archive fully executable
==== Making an Archive Fully Executable
Spring Boot provides support for fully executable archives.
An archive is made fully executable by prepending a shell script that knows how to launch the application.
On Unix-like platforms, this launch script allows the archive to be run directly like any other executable or to be installed as a service.
@ -263,7 +265,7 @@ include::../gradle/packaging/boot-war-properties-launcher.gradle.kts[tags=proper
[[packaging-layered-jars]]
==== Packaging layered jars
==== Packaging Layered Jars
By default, the `bootJar` task builds an archive that contains the application's classes and dependencies in `BOOT-INF/classes` and `BOOT-INF/lib` respectively.
For cases where a docker image needs to be built from the contents of the jar, it's useful to be able to separate these folders further so that they can be written into distinct layers.
@ -312,7 +314,7 @@ include::../gradle/packaging/boot-jar-layered-exclude-tools.gradle.kts[tags=laye
[[packaging-layers-configuration]]
===== Custom Layers configuration
===== Custom Layers Configuration
Depending on your application, you may want to tune how layers are created and add new ones.
This can be done using configuration that describes how the jar can be separated into layers, and the order of those layers.

@ -1,10 +1,10 @@
[[publishing-your-application]]
== Publishing your application
== Publishing your Application
[[publishing-your-application-maven]]
=== Publishing with the `maven` plugin
=== Publishing with the `maven` Plugin
When the {maven-plugin}[`maven` plugin] is applied, an `Upload` task for the `bootArchives` configuration named `uploadBootArchives` is automatically created.
By default, the `bootArchives` configuration contains the archive produced by the `bootJar` or `bootWar` task.
The `uploadBootArchives` task can be configured to publish the archive to a Maven repository:
@ -24,7 +24,7 @@ include::../gradle/publishing/maven.gradle.kts[tags=upload]
[[publishing-your-application-maven-publish]]
=== Publishing with the `maven-publish` plugin
=== Publishing with the `maven-publish` Plugin
To publish your Spring Boot jar or war, add it to the publication using the `artifact` method on `MavenPublication`.
Pass the task that produces that artifact that you wish to publish to the `artifact` method.
For example, to publish the artifact produced by the default `bootJar` task:
@ -44,7 +44,7 @@ include::../gradle/publishing/maven-publish.gradle.kts[tags=publishing]
[[publishing-your-application-distribution]]
=== Distributing with the `application` plugin
=== Distributing with the `application` Plugin
When the {application-plugin}[`application` plugin] is applied a distribution named `boot` is created.
This distribution contains the archive produced by the `bootJar` or `bootWar` task and scripts to launch it on Unix-like platforms and Windows.
Zip and tar distributions can be built by the `bootDistZip` and `bootDistTar` tasks respectively.

@ -1,12 +1,12 @@
[[reacting-to-other-plugins]]
== Reacting to other plugins
== Reacting to Other Plugins
When another plugin is applied the Spring Boot plugin reacts by making various changes to the project's configuration.
This section describes those changes.
[[reacting-to-other-plugins-java]]
=== Reacting to the Java plugin
=== Reacting to the Java Plugin
When Gradle's {java-plugin}[`java` plugin] is applied to a project, the Spring Boot plugin:
1. Creates a {boot-jar-javadoc}[`BootJar`] task named `bootJar` that will create an executable, fat jar for the project.
@ -22,7 +22,7 @@ When Gradle's {java-plugin}[`java` plugin] is applied to a project, the Spring B
[[reacting-to-other-plugins-kotlin]]
=== Reacting to the Kotlin plugin
=== Reacting to the Kotlin Plugin
When {kotlin-plugin}[Kotlin's Gradle plugin] is applied to a project, the Spring Boot plugin:
1. Aligns the Kotlin version used in Spring Boot's dependency management with the version of the plugin.
@ -32,7 +32,7 @@ When {kotlin-plugin}[Kotlin's Gradle plugin] is applied to a project, the Spring
[[reacting-to-other-plugins-war]]
=== Reacting to the war plugin
=== Reacting to the War Plugin
When Gradle's {war-plugin}[`war` plugin] is applied to a project, the Spring Boot plugin:
1. Creates a {boot-war-javadoc}[`BootWar`] task named `bootWar` that will create an executable, fat war for the project.
@ -44,13 +44,13 @@ When Gradle's {war-plugin}[`war` plugin] is applied to a project, the Spring Boo
[[reacting-to-other-plugins-dependency-management]]
=== Reacting to the dependency management plugin
=== Reacting to the Dependency Management Plugin
When the {dependency-management-plugin}[`io.spring.dependency-management` plugin] is applied to a project, the Spring Boot plugin will automatically import the `spring-boot-dependencies` bom.
[[reacting-to-other-plugins-application]]
=== Reacting to the application plugin
=== Reacting to the Application Plugin
When Gradle's {application-plugin}[`application` plugin] is applied to a project, the Spring Boot plugin:
1. Creates a `CreateStartScripts` task named `bootStartScripts` that will create scripts that launch the artifact in the `bootArchives` configuration using `java -jar`.

@ -1,5 +1,5 @@
[[running-your-application]]
== Running your application with Gradle
== Running your Application with Gradle
To run your application without first building an archive use the `bootRun` task:
[source,bash,indent=0,subs="verbatim"]
@ -73,7 +73,7 @@ include::../gradle/running/application-plugin-main-class-name.gradle.kts[tags=ma
[[running-your-application-passing-arguments]]
=== Passing arguments to your application
=== Passing Arguments to your Application
Like all `JavaExec` tasks, arguments can be passed into `bootRun` from the command line using `--args='<arguments>'` when using Gradle 4.9 or later.
For example, to run your application with a profile named `dev` active the following command can be used:
@ -87,7 +87,7 @@ See {gradle-api}/org/gradle/api/tasks/JavaExec.html#setArgsString-java.lang.Stri
[[running-your-application-reloading-resources]]
=== Reloading resources
=== Reloading Resources
If devtools has been added to your project it will automatically monitor your application for changes.
Alternatively, you can configure `bootRun` such that your application's static resources are loaded from their source location:

@ -1,6 +1,5 @@
[[getting-started]]
== Getting started
== Getting Started
To use the Spring Boot Maven Plugin, include the appropriate XML in the `plugins` section of your `pom.xml`, as shown in the following example:
[source,xml,indent=0,subs="verbatim,attributes"]

@ -1,5 +1,5 @@
[[help]]
== Help information
== Help Information
The `help` goal is a standard goal that displays information on the capabilities of the plugin.
include::goals/help.adoc[leveloffset=+1]

@ -1,5 +1,5 @@
[[integration-tests]]
== Running Integration tests
== Running Integration Tests
While you may start your Spring Boot application very easily from your test (or test suite) itself, it may be desirable to handle that in the build itself.
To make sure that the lifecycle of your Spring Boot application is properly managed around your integration tests, you can use the `start` and `stop` goals, as shown in the following example:

@ -1,5 +1,5 @@
[[build-image]]
== Packaging OCI images
== Packaging OCI Images
The plugin can create an https://github.com/opencontainers/image-spec[OCI image] using https://buildpacks.io/[Cloud Native Buildpacks].
Images can be built using the `build-image` goal.
@ -32,7 +32,7 @@ When the `build-image` repackages the application, it applies the same settings
[[build-image-docker-daemon]]
=== Docker daemon
=== Docker Daemon
The `build-image` goal requires access to a Docker daemon.
By default, it will communicate with a Docker daemon over a local connection.
This works with https://docs.docker.com/install/[Docker Engine] on all supported platforms without configuration.
@ -58,7 +58,7 @@ On Linux and macOS, these environment variables can be set using the command `ev
[[build-image-customization]]
=== Image customizations
=== Image Customizations
The plugin invokes a {buildpacks-reference}/concepts/components/builder/[builder] to orchestrate the generation of an image.
The builder includes multiple {buildpacks-reference}/concepts/components/buildpack[buildpacks] that can inspect the application to influence the generated image.
By default, the plugin chooses a builder image.
@ -108,7 +108,7 @@ include::goals/build-image.adoc[leveloffset=+1]
[[build-image-example-custom-image-builder]]
==== Custom image builder
==== Custom Image Builder
If you need to customize the builder used to create the image, configure the plugin as shown in the following example:
[source,xml,indent=0,subs="verbatim,attributes"]
@ -140,8 +140,10 @@ The builder can be specified on the command line as well, as shown in this examp
$ mvn spring-boot:build-image -Dspring-boot.build-image:builder=mine/java-cnb-builder
----
[[build-image-example-builder-configuration]]
==== Builder configuration
==== Builder Configuration
If the builder exposes configuration options using environment variables, those can be set using the `env` attributes.
The following example assumes that the default builder defines a `BP_JAVA_VERSION` property (typically used to customize the JDK version the image should use):
@ -197,7 +199,7 @@ When using the default builder, this can be accomplished by setting the `HTTPS_P
[[build-image-example-custom-image-name]]
==== Custom image name
==== Custom Image Name
By default, the image name is inferred from the `artifactId` and the `version` of the project, something like `docker.io/library/${project.artifactId}:${project.version}`.
You can take control over the name, as shown in the following example:

@ -1,6 +1,5 @@
[[run]]
== Running your application with Maven
== Running your Application with Maven
The plugin includes a run goal which can be used to launch your application from the command line, as shown in the following example:
[indent=0]

@ -1,5 +1,5 @@
[[using]]
== Using the plugin
== Using the Plugin
Maven users can inherit from the `spring-boot-starter-parent` project to obtain sensible defaults.
The parent project provides the following features:

Loading…
Cancel
Save