Skip to content

Commit 1702c9f

Browse files
committed
Rework title anchors for gradle docs
Closes gh-26618
1 parent f692b0e commit 1702c9f

12 files changed

+162
-112
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ repositories {
2323
}
2424

2525
dependencies {
26+
asciidoctorExtensions("io.spring.asciidoctor:spring-asciidoctor-extensions-section-ids")
27+
2628
implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-buildpack-platform"))
2729
implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))
2830
implementation("io.spring.gradle:dependency-management-plugin")
@@ -78,7 +80,6 @@ asciidoctor {
7880
sources {
7981
include "index.adoc"
8082
}
81-
attributes "stylesheet": "css/style.css"
8283
}
8384

8485
task asciidoctorPdf(type: org.asciidoctor.gradle.jvm.AsciidoctorTask) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
integrating-with-actuator=integrating-with-actuator
2+
integrating-with-actuator-build-info=integrating-with-actuator.build-info
3+
managing-dependencies=managing-dependencies
4+
managing-dependencies-dependency-management-plugin=managing-dependencies.dependency-management-plugin
5+
managing-dependencies-dependency-management-plugin-customizing=managing-dependencies.dependency-management-plugin.customizing
6+
managing-dependencies-dependency-management-plugin-using-in-isolation=managing-dependencies.dependency-management-plugin.using-in-isolation
7+
managing-dependencies-dependency-management-plugin-learning-more=managing-dependencies.dependency-management-plugin.learning-more
8+
managing-dependencies-gradle-bom-support=managing-dependencies.gradle-bom-support
9+
managing-dependencies-gradle-bom-support-customizing=managing-dependencies.gradle-bom-support.customizing
10+
build-image=build-image
11+
build-image-docker-daemon=build-image.docker-daemon
12+
build-image-docker-registry=build-image.docker-registry
13+
build-image-customization=build-image.customization
14+
build-image-examples=build-image.examples
15+
build-image-example-custom-image-builder=build-image.examples.custom-image-builder
16+
build-image-example-builder-configuration=build-image.examples.builder-configuration
17+
build-image-example-runtime-jvm-configuration=build-image.examples.runtime-jvm-configuration
18+
build-image-example-custom-image-name=build-image.examples.custom-image-name
19+
build-image-example-buildpacks=build-image.examples.buildpacks
20+
build-image-example-publish=build-image.examples.publish
21+
build-image-example-docker=build-image.examples.docker
22+
packaging-executable=packaging-executable
23+
packaging-executable-jars=packaging-executable.jars
24+
packaging-executable-wars=packaging-executable.wars
25+
packaging-executable-wars-deployable=packaging-executable.wars.deployable
26+
packaging-executable-and-plain=packaging-executable.and-plain-archives
27+
packaging-executable-configuring=packaging-executable.configuring
28+
packaging-executable-configuring-main-class=packaging-executable.configuring.main-class
29+
packaging-executable-configuring-including-development-only-dependencies=packaging-executable.configuring.including-development-only-dependencies
30+
packaging-executable-configuring-unpacking=packaging-executable.configuring.unpacking
31+
packaging-executable-configuring-launch-script=packaging-executable.configuring.launch-script
32+
packaging-executable-configuring-properties-launcher=packaging-executable.configuring.properties-launcher
33+
packaging-layered-archives=packaging-executable.configuring.layered-archives
34+
packaging-layers-configuration=packaging-executable.configuring.layered-archives.configuration
35+
publishing-your-application=publishing-your-application
36+
publishing-your-application-maven-publish=publishing-your-application.maven-publish
37+
publishing-your-application-maven=publishing-your-application.maven
38+
publishing-your-application-distribution=publishing-your-application.distribution
39+
reacting-to-other-plugins=reacting-to-other-plugins
40+
reacting-to-other-plugins-java=reacting-to-other-plugins.java
41+
reacting-to-other-plugins-kotlin=reacting-to-other-plugins.kotlin
42+
reacting-to-other-plugins-war=reacting-to-other-plugins.war
43+
reacting-to-other-plugins-dependency-management=reacting-to-other-plugins.dependency-management
44+
reacting-to-other-plugins-application=reacting-to-other-plugins.application
45+
running-your-application=running-your-application
46+
running-your-application-passing-arguments=running-your-application.passing-arguments
47+
running-your-application-passing-system-properties=running-your-application.passing-system-properties
48+
running-your-application-reloading-resources=running-your-application.reloading-resources

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/getting-started.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[getting-started]]
2-
== Getting Started
2+
= Getting Started
33
To get started with the plugin it needs to be applied to your project.
44

55
ifeval::["{spring-boot-artifactory-repo}" == "release"]

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/index.adoc

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,20 @@ Andy Wilkinson, Scott Frederick
4040

4141

4242

43-
[[introduction]]
44-
== Introduction
45-
The Spring Boot Gradle Plugin provides Spring Boot support in https://gradle.org[Gradle].
46-
It allows you to package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`.
47-
Spring Boot's Gradle plugin requires Gradle 6.8, 6.9, or 7.x and can be used with Gradle's {gradle-userguide}/configuration_cache.html[configuration cache].
43+
include::introduction.adoc[leveloffset=+1]
4844

49-
In addition to this user guide, {api-documentation}[API documentation] is also available.
45+
include::getting-started.adoc[leveloffset=+1]
5046

51-
include::getting-started.adoc[]
47+
include::managing-dependencies.adoc[leveloffset=+1]
5248

53-
include::managing-dependencies.adoc[]
49+
include::packaging.adoc[leveloffset=+1]
5450

55-
include::packaging.adoc[]
51+
include::packaging-oci-image.adoc[leveloffset=+1]
5652

57-
include::packaging-oci-image.adoc[]
53+
include::publishing.adoc[leveloffset=+1]
5854

59-
include::publishing.adoc[]
55+
include::running.adoc[leveloffset=+1]
6056

61-
include::running.adoc[]
57+
include::integrating-with-actuator.adoc[leveloffset=+1]
6258

63-
include::integrating-with-actuator.adoc[]
64-
65-
include::reacting.adoc[]
59+
include::reacting.adoc[leveloffset=+1]

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/integrating-with-actuator.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[[integrating-with-actuator]]
2-
== Integrating with Actuator
2+
= Integrating with Actuator
33

44

55

6-
[[integrating-with-actuator-build-info]]
7-
=== Generating Build Information
6+
[[integrating-with-actuator.build-info]]
7+
== Generating Build Information
88
Spring Boot Actuator's `info` endpoint automatically publishes information about your build in the presence of a `META-INF/build-info.properties` file.
99
A {build-info-javadoc}[`BuildInfo`] task is provided to generate this file.
1010
The easiest way to use the task is via the plugin's DSL:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[[introduction]]
2+
= Introduction
3+
The Spring Boot Gradle Plugin provides Spring Boot support in https://gradle.org[Gradle].
4+
It allows you to package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`.
5+
Spring Boot's Gradle plugin requires Gradle 6.8, 6.9, or 7.x and can be used with Gradle's {gradle-userguide}/configuration_cache.html[configuration cache].
6+
7+
In addition to this user guide, {api-documentation}[API documentation] is also available.

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/managing-dependencies.adoc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[[managing-dependencies]]
2-
== Managing Dependencies
2+
= Managing Dependencies
33
To manage dependencies in your Spring Boot application, you can either apply the {dependency-management-plugin}[`io.spring.dependency-management`] plugin or use Gradle's native bom support.
44
The primary benefit of the former is that it offers property-based customization of managed versions, while using the latter will likely result in faster builds.
55

66

77

8-
[[managing-dependencies-dependency-management-plugin]]
9-
=== Managing Dependencies with the Dependency Management Plugin
10-
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.
8+
[[managing-dependencies.dependency-management-plugin]]
9+
== Managing Dependencies with the Dependency Management Plugin
10+
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.
1111
This provides a similar dependency management experience to the one that's enjoyed by Maven users.
1212
For example, it allows you to omit version numbers when declaring dependencies that are managed in the bom.
1313
To make use of this functionality, declare dependencies in the usual way but omit the version number:
@@ -26,8 +26,8 @@ include::../gradle/managing-dependencies/dependencies.gradle.kts[tags=dependenci
2626

2727

2828

29-
[[managing-dependencies-dependency-management-plugin-customizing]]
30-
==== Customizing Managed Versions
29+
[[managing-dependencies.dependency-management-plugin.customizing]]
30+
=== Customizing Managed Versions
3131
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.
3232
Browse the {version-properties-appendix}[`Dependency versions Appendix`] in the Spring Boot reference for a complete list of these properties.
3333

@@ -51,8 +51,8 @@ Overriding versions may cause compatibility issues and should be done with care.
5151

5252

5353

54-
[[managing-dependencies-dependency-management-plugin-using-in-isolation]]
55-
==== Using Spring Boot's Dependency Management in Isolation
54+
[[managing-dependencies.dependency-management-plugin.using-in-isolation]]
55+
=== Using Spring Boot's Dependency Management in Isolation
5656
Spring Boot's dependency management can be used in a project without applying Spring Boot's plugin to that project.
5757
The `SpringBootPlugin` class provides a `BOM_COORDINATES` constant that can be used to import the bom without having to know its group ID, artifact ID, or version.
5858

@@ -126,14 +126,14 @@ include::../gradle/managing-dependencies/configure-bom-with-plugins.gradle.kts[t
126126

127127

128128

129-
[[managing-dependencies-dependency-management-plugin-learning-more]]
130-
==== Learning More
129+
[[managing-dependencies.dependency-management-plugin.learning-more]]
130+
=== Learning More
131131
To learn more about the capabilities of the dependency management plugin, please refer to its {dependency-management-plugin-documentation}[documentation].
132132

133133

134134

135-
[[managing-dependencies-gradle-bom-support]]
136-
=== Managing Dependencies with Gradle's Bom Support
135+
[[managing-dependencies.gradle-bom-support]]
136+
== Managing Dependencies with Gradle's Bom Support
137137
Gradle allows a bom to be used to manage a project's versions by declaring it as a `platform` or `enforcedPlatform` dependency.
138138
A `platform` dependency treats the versions in the bom as recommendations and other versions and constraints in the dependency graph may cause a version of a dependency other than that declared in the bom to be used.
139139
An `enforcedPlatform` dependency treats the versions in the bom as requirements and they will override any other version found in the dependency graph.
@@ -157,8 +157,8 @@ As a result, in may be necessary to declare the same dependency in more than one
157157

158158

159159

160-
[[managing-dependencies-gradle-bom-support-customizing]]
161-
==== Customizing Managed Versions
160+
[[managing-dependencies.gradle-bom-support.customizing]]
161+
=== Customizing Managed Versions
162162
When using Gradle's bom support, you cannot use the properties from `spring-boot-dependencies` to control the versions of the dependencies that it manages.
163163
Instead, you must use one of the mechanisms that Gradle provides.
164164
One such mechanism is a resolution strategy.

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[build-image]]
2-
== Packaging OCI Images
2+
= Packaging OCI Images
33
The plugin can create an https://github.com/opencontainers/image-spec[OCI image] from a jar or war file using https://buildpacks.io[Cloud Native Buildpacks] (CNB).
44
Images can be built using the `bootBuildImage` task.
55

@@ -8,13 +8,13 @@ See the {buildpacks-reference}/reference/spec/platform-api/#users[CNB specificat
88

99
The task is automatically created when the `java` or `war` plugin is applied and is an instance of {boot-build-image-javadoc}[`BootBuildImage`].
1010

11-
NOTE: The `bootBuildImage` task can not be used with a <<packaging-executable-configuring-launch-script, fully executable Spring Boot archive>> that includes a launch script.
11+
NOTE: The `bootBuildImage` task can not be used with a <<packaging-executable.configuring.launch-script, fully executable Spring Boot archive>> that includes a launch script.
1212
Disable launch script configuration in the `bootJar` task when building a jar file that is intended to be used with `bootBuildImage`.
1313

1414

1515

16-
[[build-image-docker-daemon]]
17-
=== Docker Daemon
16+
[[build-image.docker-daemon]]
17+
== Docker Daemon
1818
The `bootBuildImage` task requires access to a Docker daemon.
1919
By default, it will communicate with a Docker daemon over a local connection.
2020
This works with https://docs.docker.com/install/[Docker Engine] on all supported platforms without configuration.
@@ -53,12 +53,12 @@ The following table summarizes the available properties:
5353
| Path to certificate and key files for HTTPS (required if `tlsVerify` is `true`, ignored otherwise)
5454
|===
5555

56-
For more details, see also <<build-image-example-docker,examples>>.
56+
For more details, see also <<build-image.examples.docker,examples>>.
5757

5858

5959

60-
[[build-image-docker-registry]]
61-
=== Docker Registry
60+
[[build-image.docker-registry]]
61+
== Docker Registry
6262
If the Docker images specified by the `builder` or `runImage` properties are stored in a private Docker image registry that requires authentication, the authentication credentials can be provided using `docker.builderRegistry` properties.
6363

6464
If the generated Docker image is to be published to a Docker image registry, the authentication credentials can be provided using `docker.publishRegistry` properties.
@@ -87,12 +87,12 @@ The following table summarizes the available properties for `docker.builderRegis
8787
| Identity token for the Docker image registry user. Required for token authentication.
8888
|===
8989

90-
For more details, see also <<build-image-example-docker,examples>>.
90+
For more details, see also <<build-image.examples.docker,examples>>.
9191

9292

9393

94-
[[build-image-customization]]
95-
=== Image Customizations
94+
[[build-image.customization]]
95+
== Image Customizations
9696
The plugin invokes a {buildpacks-reference}/concepts/components/builder/[builder] to orchestrate the generation of an image.
9797
The builder includes multiple {buildpacks-reference}/concepts/components/buildpack[buildpacks] that can inspect the application to influence the generated image.
9898
By default, the plugin chooses a builder image.
@@ -176,17 +176,17 @@ Where `<options>` can contain:
176176

177177
NOTE: The plugin detects the target Java compatibility of the project using the JavaPlugin's `targetCompatibility` property.
178178
When using the default Paketo builder and buildpacks, the plugin instructs the buildpacks to install the same Java version.
179-
You can override this behaviour as shown in the <<build-image-example-builder-configuration,builder configuration>> examples.
179+
You can override this behaviour as shown in the <<build-image.examples.builder-configuration,builder configuration>> examples.
180180

181181

182182

183-
[[build-image-examples]]
184-
=== Examples
183+
[[build-image.examples]]
184+
== Examples
185185

186186

187187

188-
[[build-image-example-custom-image-builder]]
189-
==== Custom Image Builder and Run Image
188+
[[build-image.examples.custom-image-builder]]
189+
=== Custom Image Builder and Run Image
190190
If you need to customize the builder used to create the image or the run image used to launch the built image, configure the task as shown in the following example:
191191

192192
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
@@ -212,8 +212,8 @@ The builder and run image can be specified on the command line as well, as shown
212212

213213

214214

215-
[[build-image-example-builder-configuration]]
216-
==== Builder Configuration
215+
[[build-image.examples.builder-configuration]]
216+
=== Builder Configuration
217217
If the builder exposes configuration options, those can be set using the `environment` property.
218218

219219
The following is an example of {paketo-java-reference}/#configuring-the-jvm-version[configuring the JVM version] used by the Paketo Java buildpacks at build time:
@@ -247,8 +247,8 @@ include::../gradle/packaging/boot-build-image-env-proxy.gradle.kts[tags=env]
247247

248248

249249

250-
[[build-image-example-runtime-jvm-configuration]]
251-
==== Runtime JVM Configuration
250+
[[build-image.examples.runtime-jvm-configuration]]
251+
=== Runtime JVM Configuration
252252
Paketo Java buildpacks {paketo-java-reference}/#runtime-jvm-configuration[configure the JVM runtime environment] by setting the `JAVA_TOOL_OPTIONS` environment variable.
253253
The buildpack-provided `JAVA_TOOL_OPTIONS` value can be modified to customize JVM runtime behavior when the application image is launched in a container.
254254

@@ -268,8 +268,8 @@ include::../gradle/packaging/boot-build-image-env-runtime.gradle.kts[tags=env-ru
268268

269269

270270

271-
[[build-image-example-custom-image-name]]
272-
==== Custom Image Name
271+
[[build-image.examples.custom-image-name]]
272+
=== Custom Image Name
273273
By default, the image name is inferred from the `name` and the `version` of the project, something like `docker.io/library/${project.name}:${project.version}`.
274274
You can take control over the name by setting task properties, as shown in the following example:
275275

@@ -297,8 +297,8 @@ The image name can be specified on the command line as well, as shown in this ex
297297

298298

299299

300-
[[build-image-example-buildpacks]]
301-
==== Buildpacks
300+
[[build-image.examples.buildpacks]]
301+
=== Buildpacks
302302
By default, the builder will use buildpacks included in the builder image and apply them in a pre-defined order.
303303
An alternative set of buildpacks can be provided to apply buildpacks that are not included in the builder, or to change the order of included buildpacks.
304304
When one or more buildpacks are provided, only the specified buildpacks will be applied.
@@ -347,8 +347,8 @@ An OCI image containing a https://buildpacks.io/docs/buildpack-author-guide/pack
347347

348348

349349

350-
[[build-image-example-publish]]
351-
==== Image Publishing
350+
[[build-image.examples.publish]]
351+
=== Image Publishing
352352
The generated image can be published to a Docker registry by enabling a `publish` option and configuring authentication for the registry using `docker.publishRegistry` properties.
353353

354354
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
@@ -372,8 +372,8 @@ The publish option can be specified on the command line as well, as shown in thi
372372

373373

374374

375-
[[build-image-example-docker]]
376-
==== Docker Configuration
375+
[[build-image.examples.docker]]
376+
=== Docker Configuration
377377
If you need the plugin to communicate with the Docker daemon using a remote connection instead of the default local connection, the connection details can be provided using `docker` properties as shown in the following example:
378378

379379
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]

0 commit comments

Comments
 (0)