Skip to content

Commit f0896c2

Browse files
committed
Rework title anchors for maven docs
Closes gh-26617
1 parent 1702c9f commit f0896c2

File tree

13 files changed

+158
-111
lines changed

13 files changed

+158
-111
lines changed

buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/DocumentPluginGoals.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private void documentMojo(Plugin plugin, Mojo mojo) throws IOException {
9494
writer.println();
9595
writer.println();
9696
writer.printf("[[%s]]%n", sectionId);
97-
writer.printf("== `%s:%s`%n", plugin.getGoalPrefix(), mojo.getGoal());
97+
writer.printf("= `%s:%s`%n", plugin.getGoalPrefix(), mojo.getGoal());
9898
writer.printf("`%s:%s:%s`%n", plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion());
9999
writer.println();
100100
writer.println(mojo.getDescription());
@@ -108,7 +108,7 @@ private void documentMojo(Plugin plugin, Mojo mojo) throws IOException {
108108
writer.println();
109109
writer.println();
110110
writer.printf("[[%s-required]]%n", parametersSectionId);
111-
writer.println("=== Required parameters");
111+
writer.println("== Required parameters");
112112
writeParametersTable(writer, detailsSectionId, requiredParameters);
113113
}
114114
List<Parameter> optionalParameters = parameters.stream().filter((parameter) -> !parameter.isRequired())
@@ -117,13 +117,13 @@ private void documentMojo(Plugin plugin, Mojo mojo) throws IOException {
117117
writer.println();
118118
writer.println();
119119
writer.printf("[[%s-optional]]%n", parametersSectionId);
120-
writer.println("=== Optional parameters");
120+
writer.println("== Optional parameters");
121121
writeParametersTable(writer, detailsSectionId, optionalParameters);
122122
}
123123
writer.println();
124124
writer.println();
125125
writer.printf("[[%s]]%n", detailsSectionId);
126-
writer.println("=== Parameter details");
126+
writer.println("== Parameter details");
127127
writeParameterDetails(writer, parameters, detailsSectionId);
128128
}
129129
}
@@ -155,7 +155,7 @@ private void writeParameterDetails(PrintWriter writer, List<Parameter> parameter
155155
writer.println();
156156
writer.println();
157157
writer.printf("[[%s-%s]]%n", sectionId, name);
158-
writer.printf("==== `%s`%n", name);
158+
writer.printf("=== `%s`%n", name);
159159
writer.println(parameter.getDescription());
160160
writer.println();
161161
writer.println("[cols=\"10h,90\"]");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
build-info=?
3+
getting-started=?
4+
goals=?
5+
help=?
6+
spring-boot-maven-plugin-documentation=?
7+
introduction=?.?
8+
integration-tests=integration-tests
9+
integration-tests-no-starter-parent=integration-tests.no-starter-parent
10+
integration-tests-example=integration-tests.examples
11+
integration-tests-example-random-port=integration-tests.examples.random-port
12+
integration-tests-example-jmx-port=integration-tests.examples.jmx-port
13+
integration-tests-example-skip=integration-tests.examples.skip
14+
build-image=build-image
15+
build-image-docker-daemon=build-image.docker-daemon
16+
build-image-docker-registry=build-image.docker-registry
17+
build-image-customization=build-image.customization
18+
build-image-examples=build-image.examples
19+
build-image-example-custom-image-builder=build-image.examples.custom-image-builder
20+
build-image-example-builder-configuration=build-image.examples.builder-configuration
21+
build-image-example-runtime-jvm-configuration=build-image.examples.runtime-jvm-configuration
22+
build-image-example-custom-image-name=build-image.examples.custom-image-name
23+
build-image-example-buildpacks=build-image.examples.buildpacks
24+
build-image-example-publish=build-image.examples.publish
25+
build-image-example-docker=build-image.examples.docker
26+
repackage=packaging
27+
repackage-layers=packaging.layers
28+
repackage-layers-configuration=packaging.layers.configuration=repackage-examples=packaging.examples
29+
repackage-example-custom-classifier=packaging.examples.custom-classifier
30+
repackage-example-custom-name=packaging.examples.custom-name
31+
repackage-example-local-artifact=packaging.examples.local-artifact
32+
repackage-example-custom-layout=packaging.examples.custom-layout
33+
repackage-example-exclude-dependency=packaging.examples.exclude-dependency
34+
repackage-layered-archive-tools=packaging.examples.layered-archive-tools
35+
repackage-layered-archive-additional-layers=packaging.examples.custom-layers-configuration
36+
run=run
37+
run-examples=run.examples
38+
run-example-debug=run.examples.debug
39+
run-example-system-properties=run.examples.system-properties
40+
run-example-environment-variables=run.examples.environment-variables
41+
run-example-application-arguments=run.examples.using-application-arguments
42+
run-example-active-profiles=run.examples.specify-active-profiles
43+
using=using
44+
using-parent-pom=using.parent-pom
45+
using-import=using.import
46+
using-overriding-command-line=using.overriding-command-line

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/build-info.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[build-info]]
2-
== Integrating with Actuator
2+
= Integrating with Actuator
33
Spring Boot Actuator displays build-related information if a `META-INF/build-info.properties` file is present.
44
The `build-info` goal generates such file with the coordinates of the project and the build time.
55
It also allows you to add an arbitrary number of additional properties, as shown in the following example:

spring-boot-project/spring-boot-tools/spring-boot-maven-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 use the Spring Boot Maven Plugin, include the appropriate XML in the `plugins` section of your `pom.xml`, as shown in the following example:
44

55
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[goals]]
2-
== Goals
2+
= Goals
33
The Spring Boot Plugin has the following goals:
44

55
include::goals/overview.adoc[]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[help]]
2-
== Help Information
2+
= Help Information
33
The `help` goal is a standard goal that displays information on the capabilities of the plugin.
44

55
include::goals/help.adoc[leveloffset=+1]

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

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,22 @@ Stephane Nicoll, Andy Wilkinson, Scott Frederick
2020

2121

2222

23-
[[introduction]]
24-
== Introduction
25-
The Spring Boot Maven Plugin provides Spring Boot support in https://maven.org[Apache Maven].
26-
It allows you to package executable jar or war archives, run Spring Boot applications, generate build information and start your Spring Boot application prior to running integration tests.
23+
include::introduction.adoc[leveloffset=+1]
2724

28-
include::getting-started.adoc[]
25+
include::getting-started.adoc[leveloffset=+1]
2926

30-
include::using.adoc[]
27+
include::using.adoc[leveloffset=+1]
3128

32-
include::goals.adoc[]
29+
include::goals.adoc[leveloffset=+1]
3330

34-
include::packaging.adoc[]
31+
include::packaging.adoc[leveloffset=+1]
3532

36-
include::packaging-oci-image.adoc[]
33+
include::packaging-oci-image.adoc[leveloffset=+1]
3734

38-
include::running.adoc[]
35+
include::running.adoc[leveloffset=+1]
3936

40-
include::integration-tests.adoc[]
37+
include::integration-tests.adoc[leveloffset=+1]
4138

42-
include::build-info.adoc[]
39+
include::build-info.adoc[leveloffset=+1]
4340

44-
include::help.adoc[]
41+
include::help.adoc[leveloffset=+1]

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/integration-tests.adoc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[integration-tests]]
2-
== Running Integration Tests
2+
= Running Integration Tests
33
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.
44
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:
55

@@ -11,14 +11,14 @@ include::../maven/integration-tests/pom.xml[tags=integration-tests]
1111
Such setup can now use the https://maven.apache.org/surefire/maven-failsafe-plugin[failsafe-plugin] to run your integration tests as you would expect.
1212

1313
NOTE: By default, the application is started in a separate process and JMX is used to communicate with the application.
14-
If you need to configure the JMX port, see <<integration-tests-example-jmx-port,the dedicated example>>.
14+
If you need to configure the JMX port, see <<integration-tests.examples.jmx-port,the dedicated example>>.
1515

16-
You could also configure a more advanced setup to skip the integration tests when a specific property has been set, see <<integration-tests-example-skip,the dedicated example>>.
16+
You could also configure a more advanced setup to skip the integration tests when a specific property has been set, see <<integration-tests.examples.skip,the dedicated example>>.
1717

1818

1919

20-
[[integration-tests-no-starter-parent]]
21-
=== Using Failsafe Without Spring Boot's Parent POM
20+
[[integration-tests.no-starter-parent]]
21+
== Using Failsafe Without Spring Boot's Parent POM
2222
Spring Boot's Parent POM, `spring-boot-starter-parent`, configures Failsafe's `<classesDirectory>` to be `${project.build.outputDirectory}`.
2323
Without this configuration, which causes Failsafe to use the compiled classes rather than the repackaged jar, Failsafe cannot load your application's classes.
2424
If you are not using the parent POM, you should configure Failsafe in the same way, as shown in the following example:
@@ -34,13 +34,13 @@ include::goals/stop.adoc[leveloffset=+1]
3434

3535

3636

37-
[[integration-tests-example]]
38-
=== Examples
37+
[[integration-tests.examples]]
38+
== Examples
3939

4040

4141

42-
[[integration-tests-example-random-port]]
43-
==== Random Port for Integration Tests
42+
[[integration-tests.examples.random-port]]
43+
=== Random Port for Integration Tests
4444
One nice feature of the Spring Boot test integration is that it can allocate a free port for the web application.
4545
When the `start` goal of the plugin is used, the Spring Boot application is started separately, making it difficult to pass the actual port to the integration test itself.
4646

@@ -55,8 +55,8 @@ You can now retrieve the `test.server.port` system property in any of your integ
5555

5656

5757

58-
[[integration-tests-example-jmx-port]]
59-
==== Customize JMX port
58+
[[integration-tests.examples.jmx-port]]
59+
=== Customize JMX port
6060
The `jmxPort` property allows to customize the port the plugin uses to communicate with the Spring Boot application.
6161

6262
This example shows how you can customize the port in case `9001` is already used:
@@ -70,8 +70,8 @@ TIP: If you need to configure the JMX port, make sure to do so in the global con
7070

7171

7272

73-
[[integration-tests-example-skip]]
74-
==== Skip Integration Tests
73+
[[integration-tests.examples.skip]]
74+
=== Skip Integration Tests
7575
The `skip` property allows to skip the execution of the Spring Boot maven plugin altogether.
7676

7777
This example shows how you can skip integration tests with a command-line property and still make sure that the `repackage` goal runs:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[[introduction]]
2+
= Introduction
3+
The Spring Boot Maven Plugin provides Spring Boot support in https://maven.org[Apache Maven].
4+
It allows you to package executable jar or war archives, run Spring Boot applications, generate build information and start your Spring Boot application prior to running integration tests.

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

Lines changed: 28 additions & 28 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 `build-image` goal.
55

@@ -14,13 +14,13 @@ It is possible to automate the creation of an image whenever the `package` phase
1414
include::../maven/packaging-oci-image/pom.xml[tags=packaging-oci-image]
1515
----
1616

17-
TIP: While the buildpack runs from an <<repackage,executable archive>>, it is not necessary to execute the `repackage` goal first as the executable archive is created automatically if necessary.
17+
TIP: While the buildpack runs from an <<packaging,executable archive>>, it is not necessary to execute the `repackage` goal first as the executable archive is created automatically if necessary.
1818
When the `build-image` repackages the application, it applies the same settings as the `repackage` goal would, i.e. dependencies can be excluded using one of the exclude options, and Devtools is automatically excluded by default (you can control that using the `excludeDevtools` property).
1919

2020

2121

22-
[[build-image-docker-daemon]]
23-
=== Docker Daemon
22+
[[build-image.docker-daemon]]
23+
== Docker Daemon
2424
The `build-image` goal requires access to a Docker daemon.
2525
By default, it will communicate with a Docker daemon over a local connection.
2626
This works with https://docs.docker.com/install/[Docker Engine] on all supported platforms without configuration.
@@ -59,12 +59,12 @@ The following table summarizes the available parameters:
5959
| Path to certificate and key files for HTTPS (required if `tlsVerify` is `true`, ignored otherwise)
6060
|===
6161

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

6464

6565

66-
[[build-image-docker-registry]]
67-
=== Docker Registry
66+
[[build-image.docker-registry]]
67+
== Docker Registry
6868
If the Docker images specified by the `builder` or `runImage` parameters are stored in a private Docker image registry that requires authentication, the authentication credentials can be provided using `docker.builderRegistry` parameters.
6969

7070
If the generated Docker image is to be published to a Docker image registry, the authentication credentials can be provided using `docker.publishRegistry` parameters.
@@ -93,12 +93,12 @@ The following table summarizes the available parameters for `docker.builderRegis
9393
| Identity token for the Docker image registry user. Required for token authentication.
9494
|===
9595

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

9898

9999

100-
[[build-image-customization]]
101-
=== Image Customizations
100+
[[build-image.customization]]
101+
== Image Customizations
102102
The plugin invokes a {buildpacks-reference}/concepts/components/builder/[builder] to orchestrate the generation of an image.
103103
The builder includes multiple {buildpacks-reference}/concepts/components/buildpack[buildpacks] that can inspect the application to influence the generated image.
104104
By default, the plugin chooses a builder image.
@@ -182,21 +182,21 @@ Where `<options>` can contain:
182182

183183
NOTE: The plugin detects the target Java compatibility of the project using the compiler's plugin configuration or the `maven.compiler.target` property.
184184
When using the default Paketo builder and buildpacks, the plugin instructs the buildpacks to install the same Java version.
185-
You can override this behaviour as shown in the <<build-image-example-builder-configuration,builder configuration>> examples.
185+
You can override this behaviour as shown in the <<build-image.examples.builder-configuration,builder configuration>> examples.
186186

187-
For more details, see also <<build-image-examples,examples>>.
187+
For more details, see also <<build-image.examples,examples>>.
188188

189189
include::goals/build-image.adoc[leveloffset=+1]
190190

191191

192192

193-
[[build-image-examples]]
194-
=== Examples
193+
[[build-image.examples]]
194+
== Examples
195195

196196

197197

198-
[[build-image-example-custom-image-builder]]
199-
==== Custom Image Builder
198+
[[build-image.examples.custom-image-builder]]
199+
=== Custom Image Builder
200200
If you need to customize the builder used to create the image or the run image used to launch the built image, configure the plugin as shown in the following example:
201201

202202
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
@@ -215,8 +215,8 @@ The builder and run image can be specified on the command line as well, as shown
215215

216216

217217

218-
[[build-image-example-builder-configuration]]
219-
==== Builder Configuration
218+
[[build-image.examples.builder-configuration]]
219+
=== Builder Configuration
220220
If the builder exposes configuration options using environment variables, those can be set using the `env` attributes.
221221

222222
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:
@@ -236,8 +236,8 @@ include::../maven/packaging-oci-image/paketo-pom.xml[tags=paketo]
236236

237237

238238

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

@@ -250,8 +250,8 @@ include::../maven/packaging-oci-image/runtime-jvm-configuration-pom.xml[tags=run
250250

251251

252252

253-
[[build-image-example-custom-image-name]]
254-
==== Custom Image Name
253+
[[build-image.examples.custom-image-name]]
254+
=== Custom Image Name
255255
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}`.
256256
You can take control over the name, as shown in the following example:
257257

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

273273

274274

275-
[[build-image-example-buildpacks]]
276-
==== Buildpacks
275+
[[build-image.examples.buildpacks]]
276+
=== Buildpacks
277277
By default, the builder will use buildpacks included in the builder image and apply them in a pre-defined order.
278278
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.
279279
When one or more buildpacks are provided, only the specified buildpacks will be applied.
@@ -315,8 +315,8 @@ An OCI image containing a https://buildpacks.io/docs/buildpack-author-guide/pack
315315

316316

317317

318-
[[build-image-example-publish]]
319-
==== Image Publishing
318+
[[build-image.examples.publish]]
319+
=== Image Publishing
320320
The generated image can be published to a Docker registry by enabling a `publish` option and configuring authentication for the registry using `docker.publishRegistry` parameters.
321321

322322
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
@@ -333,8 +333,8 @@ The `publish` option can be specified on the command line as well, as shown in t
333333

334334

335335

336-
[[build-image-example-docker]]
337-
==== Docker Configuration
336+
[[build-image.examples.docker]]
337+
=== Docker Configuration
338338
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` parameters as shown in the following example:
339339

340340
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]

0 commit comments

Comments
 (0)