From 5595fb242382a9ee0f8cfc146b915163366295dc Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Wed, 31 Mar 2021 14:04:25 -0500 Subject: [PATCH] Polish "Extract XML examples from Maven plugin adoc files" See gh-25534 --- .../src/docs/asciidoc/integration-tests.adoc | 10 ++-------- .../src/docs/asciidoc/packaging.adoc | 6 +++--- .../src/docs/asciidoc/running.adoc | 4 ++-- .../maven/integration-tests/failsafe-pom.xml | 19 +++++++++++++++++++ .../packaging/exclude-artifact-group-pom.xml | 2 +- .../maven/packaging/exclude-artifact-pom.xml | 4 ++-- .../maven/packaging/jar-plugin-first-pom.xml | 4 ++-- .../docs/maven/packaging/repackage-pom.xml | 5 ++--- .../maven/running/active-profiles-pom.xml | 4 ++-- 9 files changed, 35 insertions(+), 23 deletions(-) create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/failsafe-pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/integration-tests.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/integration-tests.adoc index b844cd75f8..6d320ee59d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/integration-tests.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/integration-tests.adoc @@ -23,15 +23,9 @@ Spring Boot's Parent POM, `spring-boot-starter-parent`, configures Failsafe's `< Without this configuration, which causes Failsafe to use the compiled classes rather than the repackaged jar, Failsafe cannot load your application's classes. If you are not using the parent POM, you should configure Failsafe in the same way, as shown in the following example: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - org.apache.maven.plugins - maven-failsafe-plugin - - ${project.build.outputDirectory} - - +include::../maven/integration-tests/failsafe-pom.xml[tags=failsafe] ---- include::goals/start.adoc[leveloffset=+1] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging.adoc index a37810df33..3af635415c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging.adoc @@ -169,7 +169,7 @@ Again, if you are using `spring-boot-starter-parent`, this can be simplified as [source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- -include::../maven/packaging/classified-artifact-pom.xml[tags=classified-artifact] +include::../maven/packaging/jar-plugin-first-pom.xml[tags=jar-plugin-first] ---- @@ -231,14 +231,14 @@ There are two ways one can exclude a dependency from being packaged/used at runt * Exclude a specific artifact identified by `groupId` and `artifactId`, optionally with a `classifier` if needed. * Exclude any artifact belonging to a given `groupId`. -The following example excludes `com.foo:bar`, and only that artifact: +The following example excludes `com.example:module1`, and only that artifact: [source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- include::../maven/packaging/exclude-artifact-pom.xml[tags=exclude-artifact] ---- -This example excludes any artifact belonging to the `com.foo` group: +This example excludes any artifact belonging to the `com.example` group: [source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/running.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/running.adoc index ac3a3b0819..61ad0a7de5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/running.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/running.adoc @@ -163,7 +163,7 @@ In the following example, two arguments are available: `property1` and `property ==== Specify Active Profiles The active profiles to use for a particular application can be specified using the `profiles` argument. -The following configuration enables the `foo` and `bar` profiles: +The following configuration enables the `local` and `dev` profiles: [source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- @@ -174,7 +174,7 @@ The profiles to enable can be specified on the command line as well, make sure t [indent=0] ---- - $ mvn spring-boot:run -Dspring-boot.run.profiles=foo,bar + $ mvn spring-boot:run -Dspring-boot.run.profiles=local,dev ---- diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/failsafe-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/failsafe-pom.xml new file mode 100644 index 0000000000..d6e8993581 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/failsafe-pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + integration-tests + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + ${project.build.outputDirectory} + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-artifact-group-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-artifact-group-pom.xml index 1f69dbd062..aef38a7cf5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-artifact-group-pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-artifact-group-pom.xml @@ -7,7 +7,7 @@ org.springframework.boot spring-boot-maven-plugin - com.foo + com.example diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-artifact-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-artifact-pom.xml index 85ede9915c..1a969d14dc 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-artifact-pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-artifact-pom.xml @@ -9,8 +9,8 @@ - com.foo - bar + com.example + module1 diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/jar-plugin-first-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/jar-plugin-first-pom.xml index 1aa849fd0f..c39b02d3cf 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/jar-plugin-first-pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/jar-plugin-first-pom.xml @@ -1,5 +1,5 @@ - + @@ -30,5 +30,5 @@ - + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/repackage-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/repackage-pom.xml index c5401e6098..ee7d5584e0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/repackage-pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/repackage-pom.xml @@ -1,9 +1,9 @@ - 4.0.0 packaging + @@ -19,6 +19,5 @@ + - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/active-profiles-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/active-profiles-pom.xml index 3a3daddb1f..9eb58adb69 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/active-profiles-pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/active-profiles-pom.xml @@ -8,8 +8,8 @@ spring-boot-maven-plugin - foo - bar + local + dev