From 021268c5be56e68de73f1707cc6c8be58a45f5b8 Mon Sep 17 00:00:00 2001 From: robert-smith-911 Date: Fri, 5 Mar 2021 21:24:35 -0500 Subject: [PATCH 1/8] Pull out xml from adoc files --- .../src/docs/asciidoc/build-info.adoc | 28 +----------- .../src/docs/asciidoc/getting-started.adoc | 32 +++---------- .../src/docs/maven/build-info/pom.xml | 32 +++++++++++++ .../plugin-repositories-pom.xml | 44 ++++++++++++++++++ .../src/docs/maven/getting-started/pom.xml | 18 ++++++++ .../src/docs/maven/running/pom.xml | 45 +++++++++++++++++++ 6 files changed, 147 insertions(+), 52 deletions(-) create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/build-info/pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/plugin-repositories-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/build-info.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/build-info.adoc index 252d2d7c444d..e5f9612c84af 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/build-info.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/build-info.adoc @@ -4,33 +4,9 @@ Spring Boot Actuator displays build-related information if a `META-INF/build-inf The `build-info` goal generates such file with the coordinates of the project and the build time. It also allows you to add an arbitrary number of additional properties, as shown in the following example: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - build-info - - - - UTF-8 - UTF-8 - ${maven.compiler.source} - ${maven.compiler.target} - - - - - - - - +include::../maven/build-info/pom.xml[tags=build-info] ---- This configuration will generate a `build-info.properties` at the expected location with four additional keys. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/getting-started.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/getting-started.adoc index a3ed014f0ff3..36ea76c2c47b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/getting-started.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/getting-started.adoc @@ -2,38 +2,18 @@ == 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"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - 4.0.0 - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - +include::../maven/getting-started/pom.xml[tags=getting-started] ---- + + If you use a milestone or snapshot release, you also need to add the appropriate `pluginRepository` elements, as shown in the following listing: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - spring-snapshots - https://repo.spring.io/snapshot - - - spring-milestones - https://repo.spring.io/milestone - - +include::../maven/getting-started/plugin-repositories-pom.xml[tags=plugin-repositories] ---- diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/build-info/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/build-info/pom.xml new file mode 100644 index 000000000000..e620b6964422 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/build-info/pom.xml @@ -0,0 +1,32 @@ + + + + 4.0.0 + build-info + + + + org.springframework.boot + spring-boot-maven-plugin + + + + build-info + + + + UTF-8 + UTF-8 + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/plugin-repositories-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/plugin-repositories-pom.xml new file mode 100644 index 000000000000..25b86764f630 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/plugin-repositories-pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + getting-started + + + + org.springframework.boot + spring-boot-maven-plugin + + + + build-info + + + + UTF-8 + UTF-8 + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + + + + + + spring-snapshots + https://repo.spring.io/snapshot + + + spring-milestones + https://repo.spring.io/milestone + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/pom.xml new file mode 100644 index 000000000000..6467cc32e94c --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/pom.xml @@ -0,0 +1,18 @@ + + + + 4.0.0 + getting-started + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/pom.xml new file mode 100644 index 000000000000..e30f4ad5ec0c --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + org.springframework.boot + spring-boot-maven-plugin + {{version}} + maven-plugin + Spring Boot Maven Plugin + https://projects.spring.io/spring-boot/# + + UTF-8 + + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0 + + + + https://github.com/spring-projects/spring-boot + scm:git:git://github.com/spring-projects/spring-boot.git + scm:git:ssh://git@github.com/spring-projects/spring-boot.git + + + GitHub + https://github.com/spring-projects/spring-boot/issues + + + Pivotal Software, Inc. + https://spring.io + + + + + org.apache.maven.plugins + maven-plugin-plugin + 3.6.0 + + org.springframework.boot.maven + + + + + \ No newline at end of file From 469183e2dfa073d8785a480ee8e5fc4deb2cf80e Mon Sep 17 00:00:00 2001 From: robert-smith-911 Date: Sat, 6 Mar 2021 00:47:26 -0500 Subject: [PATCH 2/8] Refactor xml in integration-tests.adoc into new pom files --- .../src/docs/asciidoc/integration-tests.adoc | 157 +----------------- .../src/docs/maven/build-info/pom.xml | 3 +- .../plugin-repositories-pom.xml | 3 +- .../src/docs/maven/getting-started/pom.xml | 3 +- .../customize-jmx-port-pom.xml | 33 ++++ .../src/docs/maven/integration-tests/pom.xml | 30 ++++ .../integration-tests/random-port-pom.xml | 62 +++++++ .../skip-integration-tests-pom.xml | 44 +++++ 8 files changed, 180 insertions(+), 155 deletions(-) create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/customize-jmx-port-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/random-port-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/skip-integration-tests-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 df2f2e49d804..146dbc527c2b 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 @@ -3,30 +3,9 @@ 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: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - org.springframework.boot - spring-boot-maven-plugin - - - pre-integration-test - - start - - - - post-integration-test - - stop - - - - - - +include::../maven/integration-tests/pom.xml[tags=integration-tests] ---- 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. @@ -54,64 +33,9 @@ When the `start` goal of the plugin is used, the Spring Boot application is star The example below showcases how you could achieve the same feature using the https://www.mojohaus.org/build-helper-maven-plugin[Build Helper Maven Plugin]: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - reserve-tomcat-port - - reserve-network-port - - process-resources - - - tomcat.http.port - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - pre-integration-test - - start - - - - --server.port=${tomcat.http.port} - - - - - post-integration-test - - stop - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - ${tomcat.http.port} - - - - - - +include::../maven/integration-tests/random-port-pom.xml[tags=random-port] ---- You can now retrieve the `test.server.port` system property in any of your integration test to create a proper `URL` to the server. @@ -124,35 +48,9 @@ The `jmxPort` property allows to customize the port the plugin uses to communica This example shows how you can customize the port in case `9001` is already used: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - 9009 - - - - pre-integration-test - - start - - - - post-integration-test - - stop - - - - - - - +include::../maven/integration-tests/customize-jmx-port-pom.xml[tags=customize-jmx-port] ---- TIP: If you need to configure the JMX port, make sure to do so in the global configuration as shown above so that it is shared by both goals. @@ -165,48 +63,9 @@ The `skip` property allows to skip the execution of the Spring Boot maven plugin This example shows how you can skip integration tests with a command-line property and still make sure that the `repackage` goal runs: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - false - - - - - org.springframework.boot - spring-boot-maven-plugin - - - pre-integration-test - - start - - - ${skip.it} - - - - post-integration-test - - stop - - - ${skip.it} - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - ${skip.it} - - - - - +include::../maven/integration-tests/skip-integration-tests-pom.xml[tags=skip-integration-tests] ---- By default, the integration tests will run but this setup allows you to easily disable them on the command-line as follows: diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/build-info/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/build-info/pom.xml index e620b6964422..976cd10e77c3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/build-info/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/build-info/pom.xml @@ -1,7 +1,6 @@ - + 4.0.0 build-info diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/plugin-repositories-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/plugin-repositories-pom.xml index 25b86764f630..ff2203b1efc7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/plugin-repositories-pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/plugin-repositories-pom.xml @@ -1,6 +1,5 @@ - + 4.0.0 getting-started diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/pom.xml index 6467cc32e94c..6c2d900e60be 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/getting-started/pom.xml @@ -1,7 +1,6 @@ - + 4.0.0 getting-started diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/customize-jmx-port-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/customize-jmx-port-pom.xml new file mode 100644 index 000000000000..cf479e59f3ab --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/customize-jmx-port-pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + build-info + + + + + org.springframework.boot + spring-boot-maven-plugin + + 9009 + + + + pre-integration-test + + start + + + + post-integration-test + + stop + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/pom.xml new file mode 100644 index 000000000000..536ee8936d06 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + build-info + + + + + org.springframework.boot + spring-boot-maven-plugin + + + pre-integration-test + + start + + + + post-integration-test + + stop + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/random-port-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/random-port-pom.xml new file mode 100644 index 000000000000..6aedaee9f995 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/random-port-pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + build-info + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + reserve-tomcat-port + + reserve-network-port + + process-resources + + + tomcat.http.port + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + pre-integration-test + + start + + + + --server.port=${tomcat.http.port} + + + + + post-integration-test + + stop + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + ${tomcat.http.port} + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/skip-integration-tests-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/skip-integration-tests-pom.xml new file mode 100644 index 000000000000..ef2d20d0236e --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/skip-integration-tests-pom.xml @@ -0,0 +1,44 @@ + + + + + false + + + + + org.springframework.boot + spring-boot-maven-plugin + + + pre-integration-test + + start + + + ${skip.it} + + + + post-integration-test + + stop + + + ${skip.it} + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + ${skip.it} + + + + + + + From 698423771e634fae6185e4143e3b6cafe45aafa4 Mon Sep 17 00:00:00 2001 From: robert-smith-911 Date: Sat, 6 Mar 2021 18:08:39 -0500 Subject: [PATCH 3/8] Refactor xml in integration-tests.adoc into new pom files --- .../docs/asciidoc/packaging-oci-image.adoc | 207 ++---------------- .../src/docs/asciidoc/running.adoc | 124 ++--------- ...mage-example-builder-configuration-pom.xml | 21 ++ .../packaging-oci-image/buildpacks-pom.xml | 22 ++ .../custom-image-builder-pom.xml | 20 ++ .../custom-image-name-pom.xml | 22 ++ .../maven/packaging-oci-image/docker-pom.xml | 28 +++ .../docker-registry-authentication-pom.xml | 24 ++ .../packaging-oci-image/docker-remote-pom.xml | 21 ++ .../docker-token-authentication-pom.xml | 21 ++ .../maven/packaging-oci-image/paketo-pom.xml | 22 ++ .../docs/maven/packaging-oci-image/pom.xml | 24 ++ .../src/docs/maven/packaging/pom.xml | 17 ++ .../maven/running/active-profiles-pom.xml | 19 ++ .../running/application-arguments-pom.xml | 21 ++ .../src/docs/maven/running/debug-pom.xml | 20 ++ .../src/docs/maven/running/devtools-pom.xml | 26 +++ .../running/environment-variables-pom.xml | 23 ++ .../docs/maven/running/hot-refresh-pom.xml | 29 +++ .../src/docs/maven/running/pom.xml | 45 ---- .../maven/running/system-properties-pom.xml | 24 ++ 21 files changed, 439 insertions(+), 341 deletions(-) create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/build-image-example-builder-configuration-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/buildpacks-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/custom-image-builder-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/custom-image-name-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-registry-authentication-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-remote-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-token-authentication-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/paketo-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/active-profiles-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/application-arguments-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/debug-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/devtools-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/environment-variables-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/hot-refresh-pom.xml delete mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/system-properties-pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc index d8f67fe82ddf..e82f2b305dae 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc @@ -11,23 +11,9 @@ NOTE: The `build-image` goal is not supported with projects using < - - - org.springframework.boot - spring-boot-maven-plugin - - - - build-image - - - - - - +include::../maven/packaging-oci-image/pom.xml[tags=packaging-oci-image] ---- TIP: While the buildpack runs from an <>, it is not necessary to execute the `repackage` goal first as the executable archive is created automatically if necessary. @@ -215,24 +201,9 @@ include::goals/build-image.adoc[leveloffset=+1] ==== Custom Image Builder 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: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - mine/java-cnb-builder - mine/java-cnb-run - - - - - - +include::../maven/packaging-oci-image/custom-image-builder-pom.xml[tags=custom-image-builder] ---- This configuration will use a builder image with the name `mine/java-cnb-builder` and the tag `latest`, and the run image named `mine/java-cnb-run` and the tag `latest`. @@ -252,25 +223,9 @@ If the builder exposes configuration options using environment variables, those 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: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - 8.* - - - - - - - +include::../maven/packaging-oci-image/build-image-example-builder-configuration-pom.xml[tags=build-image-example-builder-configuration] ---- In a similar way, Paketo Java buildpacks support {paketo-java-reference}/#runtime-jvm-configuration[configuring JVM runtime behavior]. @@ -279,26 +234,9 @@ Refer to the {paketo-java-reference}[Paketo documentation] for additional config If there is a network proxy between the Docker daemon the builder runs in and network locations that buildpacks download artifacts from, you will need to configure the builder to use the proxy. When using the Paketo builder, this can be accomplished by setting the `HTTPS_PROXY` and/or `HTTP_PROXY` environment variables as show in the following example: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - http://proxy.example.com - https://proxy.example.com - - - - - - - +include::../maven/packaging-oci-image/paketo-pom.xml[tags=paketo] ---- @@ -308,23 +246,9 @@ When using the Paketo builder, this can be accomplished by setting the `HTTPS_PR 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: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - example.com/library/${project.artifactId} - - - - - - +include::../maven/packaging-oci-image/custom-image-name-pom.xml[tags=custom-image-name] ---- NOTE: This configuration does not provide an explicit tag so `latest` is used. @@ -347,26 +271,9 @@ When one or more buildpacks are provided, only the specified buildpacks will be The following example instructs the builder to use a custom buildpack packaged in a `.tgz` file, followed by a buildpack included in the builder. -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - file:///path/to/example-buildpack.tgz - urn:cnb:builder:paketo-buildpacks/java - - - - - - - +include::../maven/packaging-oci-image/buildpacks-pom.xml[tags=buildpacks] ---- Buildpacks can be specified in any of the forms shown below. @@ -403,32 +310,9 @@ An OCI image containing a https://buildpacks.io/docs/buildpack-author-guide/pack ==== Image Publishing 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. -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - docker.example.com/library/${project.artifactId} - true - - - - user - secret - https://docker.example.com/v1/ - user@example.com - - - - - - - +include::../maven/packaging-oci-image/docker-pom.xml[tags=docker] ---- The `publish` option can be specified on the command line as well, as shown in this example: @@ -444,72 +328,21 @@ The `publish` option can be specified on the command line as well, as shown in t ==== Docker Configuration 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: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - tcp://192.168.99.100:2376 - true - /home/user/.minikube/certs - - - - - - +include::../maven/packaging-oci-image/docker-remote-pom.xml[tags=docker-remote] ---- If the builder or run image are stored in a private Docker registry that supports user authentication, authentication details can be provided using `docker.builderRegistry` parameters as shown in the following example: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - user - secret - https://docker.example.com/v1/ - user@example.com - - - - - - - +include::../maven/packaging-oci-image/docker-registry-authentication-pom.xml[tags=docker-registry-authentication] ---- If the builder or run image is stored in a private Docker registry that supports token authentication, the token value can be provided using `docker.builderRegistry` parameters as shown in the following example: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - 9cbaf023786cd7... - - - - - - - +include::../maven/packaging-oci-image/docker-token-authentication-pom.xml[tags=docker-token-authentication] ---- 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 7b11efc6291d..ac3a3b081931 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 @@ -21,17 +21,12 @@ Doing so means that the `jvmArguments`, `systemPropertyVariables`, `environmentV Spring Boot `devtools` is a module to improve the development-time experience when working on Spring Boot applications. To enable it, just add the following dependency to your project: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - org.springframework.boot - spring-boot-devtools - true - - +include::../maven/running/devtools-pom.xml[tags=devtools] ---- + When `devtools` is running, it detects change when you recompile your application and automatically refreshes it. This works for not only resources but code as well. It also provides a LiveReload server so that it can automatically trigger a browser refresh whenever things change. @@ -47,19 +42,9 @@ Just include the following property in your project: Prior to `devtools`, the plugin supported hot refreshing of resources by default which has now be disabled in favour of the solution described above. You can restore it at any time by configuring your project: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - +include::../maven/running/hot-refresh-pom.xml[tags=hot-refresh] ---- When `addResources` is enabled, any `src/main/resources` directory will be added to the application classpath when you run the application and any duplicate found in `target/classes` will be removed. @@ -93,23 +78,9 @@ By default, the `run` goal runs your application in a forked process. If you need to debug it, you should add the necessary JVM arguments to enable remote debugging. The following configuration suspend the process until a debugger has joined on port 5005: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 - - - - - - +include::../maven/running/debug-pom.xml[tags=debug] ---- These arguments can be specified on the command line as well, make sure to wrap that properly, that is: @@ -126,27 +97,9 @@ These arguments can be specified on the command line as well, make sure to wrap System properties can be specified using the `systemPropertyVariables` attribute. The following example sets `property1` to `test` and `property2` to 42: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - 42 - - - - org.springframework.boot - spring-boot-maven-plugin - - - test - ${my.value} - - - - - - +include::../maven/running/system-properties-pom.xml[tags=system-properties] ---- If the value is empty or not defined (i.e. `), the system property is set with an empty String as the value. @@ -170,26 +123,9 @@ In the following example, the value for `property1` is `overridden`: Environment variables can be specified using the `environmentVariables` attribute. The following example sets the 'ENV1', 'ENV2', 'ENV3', 'ENV4' env variables: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - 5000 - Some Text - - - - - - - - +include::../maven/running/environment-variables-pom.xml[tags=environment-variables] ---- If the value is empty or not defined (i.e. `), the env variable is set with an empty String as the value. @@ -207,24 +143,9 @@ Environment variables defined this way take precedence over existing values. Application arguments can be specified using the `arguments` attribute. The following example sets two arguments: `property1` and `property2=42`: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - property1 - property2=${my.value} - - - - - - +include::../maven/running/application-arguments-pom.xml[tags=application-arguments] ---- On the command-line, arguments are separated by a space the same way `jvmArguments` are. @@ -244,24 +165,9 @@ The active profiles to use for a particular application can be specified using t The following configuration enables the `foo` and `bar` profiles: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - foo - bar - - - - - - +include::../maven/running/active-profiles-pom.xml[tags=active-profiles] ---- The profiles to enable can be specified on the command line as well, make sure to separate them with a comma, as shown in the following example: diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/build-image-example-builder-configuration-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/build-image-example-builder-configuration-pom.xml new file mode 100644 index 000000000000..5e6dde3e797d --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/build-image-example-builder-configuration-pom.xml @@ -0,0 +1,21 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + 8.* + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/buildpacks-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/buildpacks-pom.xml new file mode 100644 index 000000000000..fed32dda8887 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/buildpacks-pom.xml @@ -0,0 +1,22 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + file:///path/to/example-buildpack.tgz + urn:cnb:builder:paketo-buildpacks/java + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/custom-image-builder-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/custom-image-builder-pom.xml new file mode 100644 index 000000000000..f93c97fa6261 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/custom-image-builder-pom.xml @@ -0,0 +1,20 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + mine/java-cnb-builder + mine/java-cnb-run + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/custom-image-name-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/custom-image-name-pom.xml new file mode 100644 index 000000000000..857a716e24c3 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/custom-image-name-pom.xml @@ -0,0 +1,22 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + http://proxy.example.com + https://proxy.example.com + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-pom.xml new file mode 100644 index 000000000000..377b0c717274 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-pom.xml @@ -0,0 +1,28 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + docker.example.com/library/${project.artifactId} + true + + + + user + secret + https://docker.example.com/v1/ + user@example.com + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-registry-authentication-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-registry-authentication-pom.xml new file mode 100644 index 000000000000..478aaf01945f --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-registry-authentication-pom.xml @@ -0,0 +1,24 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + user + secret + https://docker.example.com/v1/ + user@example.com + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-remote-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-remote-pom.xml new file mode 100644 index 000000000000..942e3cdebdb6 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-remote-pom.xml @@ -0,0 +1,21 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + tcp://192.168.99.100:2376 + true + /home/user/.minikube/certs + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-token-authentication-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-token-authentication-pom.xml new file mode 100644 index 000000000000..6ac77fab6b96 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/docker-token-authentication-pom.xml @@ -0,0 +1,21 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + 9cbaf023786cd7... + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/paketo-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/paketo-pom.xml new file mode 100644 index 000000000000..ce818d71fcc2 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/paketo-pom.xml @@ -0,0 +1,22 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + http://proxy.example.com + https://proxy.example.com + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/pom.xml new file mode 100644 index 000000000000..7445b14ad62d --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + packaging-oci-image + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + build-image + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/pom.xml new file mode 100644 index 000000000000..6c2d900e60be --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/pom.xml @@ -0,0 +1,17 @@ + + + + 4.0.0 + getting-started + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + 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 new file mode 100644 index 000000000000..3a3daddb1fa6 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/active-profiles-pom.xml @@ -0,0 +1,19 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + foo + bar + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/application-arguments-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/application-arguments-pom.xml new file mode 100644 index 000000000000..cf0a1848a2ba --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/application-arguments-pom.xml @@ -0,0 +1,21 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + property1 + property2=${my.value} + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/debug-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/debug-pom.xml new file mode 100644 index 000000000000..08db158eb8bf --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/debug-pom.xml @@ -0,0 +1,20 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/devtools-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/devtools-pom.xml new file mode 100644 index 000000000000..172f51cc1b8b --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/devtools-pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + getting-started + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + + org.springframework.boot + spring-boot-devtools + true + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/environment-variables-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/environment-variables-pom.xml new file mode 100644 index 000000000000..ebc1741b1065 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/environment-variables-pom.xml @@ -0,0 +1,23 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + 5000 + Some Text + + + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/hot-refresh-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/hot-refresh-pom.xml new file mode 100644 index 000000000000..190bd2c5613b --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/hot-refresh-pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + getting-started + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + + + + + org.springframework.boot + spring-boot-devtools + true + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/pom.xml deleted file mode 100644 index e30f4ad5ec0c..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - org.springframework.boot - spring-boot-maven-plugin - {{version}} - maven-plugin - Spring Boot Maven Plugin - https://projects.spring.io/spring-boot/# - - UTF-8 - - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0 - - - - https://github.com/spring-projects/spring-boot - scm:git:git://github.com/spring-projects/spring-boot.git - scm:git:ssh://git@github.com/spring-projects/spring-boot.git - - - GitHub - https://github.com/spring-projects/spring-boot/issues - - - Pivotal Software, Inc. - https://spring.io - - - - - org.apache.maven.plugins - maven-plugin-plugin - 3.6.0 - - org.springframework.boot.maven - - - - - \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/system-properties-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/system-properties-pom.xml new file mode 100644 index 000000000000..5923b0dd3d4f --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/system-properties-pom.xml @@ -0,0 +1,24 @@ + + + + + + 42 + + + + org.springframework.boot + spring-boot-maven-plugin + + + test + ${my.value} + + + + + + + + + From a315c3baa3d655ed22f4e5571ba63b039f84af67 Mon Sep 17 00:00:00 2001 From: robert-smith-911 Date: Sun, 7 Mar 2021 19:00:55 -0500 Subject: [PATCH 4/8] Refactor xml in integration-tests.adoc into new pom files --- .../src/docs/asciidoc/packaging.adoc | 417 ++---------------- .../packaging/classified-artifact-pom.xml | 40 ++ .../maven/packaging/custom-layers-pom.xml | 20 + .../maven/packaging/custom-layout-pom.xml | 34 ++ .../docs/maven/packaging/custom-name-pom.xml | 23 + .../packaging/different-classifier-pom.xml | 25 ++ .../maven/packaging/disable-layers-pom.xml | 19 + .../packaging/exclude-artifact-group-pom.xml | 17 + .../maven/packaging/exclude-artifact-pom.xml | 22 + .../packaging/exclude-dependency-pom.xml | 19 + .../maven/packaging/jar-plugin-first-pom.xml | 34 ++ .../maven/packaging/layers-configuration.xml | 29 ++ .../src/docs/maven/packaging/layers.xml | 28 ++ .../local-repackaged-artifact-pom.xml | 25 ++ .../docs/maven/packaging/non-default-pom.xml | 29 ++ .../packaging/repackage-configuration-pom.xml | 22 + .../packaging/{pom.xml => repackage-pom.xml} | 11 +- 17 files changed, 443 insertions(+), 371 deletions(-) create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/classified-artifact-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/custom-layers-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/custom-layout-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/custom-name-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/different-classifier-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/disable-layers-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-artifact-group-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-artifact-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-dependency-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/jar-plugin-first-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/layers-configuration.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/layers.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/local-repackaged-artifact-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/non-default-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/repackage-configuration-pom.xml rename spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/{pom.xml => repackage-pom.xml} (64%) 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 1787519fe78b..cd50ddaa4e61 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 @@ -5,23 +5,9 @@ The plugin can create executable archives (jar files and war files) that contain Packaging an executable archive is performed by the `repackage` goal, as shown in the following example: -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - org.springframework.boot - spring-boot-maven-plugin - - - - repackage - - - - - - +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] +---- +include::../maven/packaging/repackage-pom.xml[tags=repackage] ---- TIP: If you are using `spring-boot-starter-parent`, such execution is already pre-configured with a `repackage` execution ID so that only the plugin definition should be added. @@ -40,27 +26,9 @@ The plugin rewrites your manifest, and in particular it manages the `Main-Class` If the defaults don't work you have to configure the values in the Spring Boot plugin, not in the jar plugin. The `Main-Class` in the manifest is controlled by the `layout` property of the Spring Boot plugin, as shown in the following example: -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - org.springframework.boot - spring-boot-maven-plugin - - ${start.class} - ZIP - - - - - repackage - - - - - - +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] +---- +include::../maven/packaging/non-default-pom.xml[tags=non-default] ---- The `layout` property defaults to a value determined by the archive type (`jar` or `war`). The following layouts are available: @@ -97,86 +65,32 @@ Content that is least likely to change should be added first, followed by layers The repackaged archive includes the `layers.idx` file by default. To disable this feature, you can do so in the following manner: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - false - - - - - - +include::../maven/packaging/disable-layers-pom.xml[tags=disable-layers] ---- - [[repackage-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 a separate configuration file that should be registered as shown below: -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - true - ${project.basedir}/src/layers.xml - - - - - - +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] +---- +include::../maven/packaging/custom-layers-pom.xml[tags=custom-layers] ---- The configuration file describes how an archive can be separated into layers, and the order of those layers. The following example shows how the default ordering described above can be defined explicitly: -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - org/springframework/boot/loader/** - - - - - - - - - *:*:*SNAPSHOT - - - - - dependencies - spring-boot-loader - snapshot-dependencies - application - - +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] +---- +include::../maven/packaging/layers.xml[tags=layers] ---- + The `layers` XML format is defined in three sections: * The `` block defines how the application classes and resources should be layered. @@ -224,55 +138,19 @@ The reason for that is that application classes are packaged in `BOOT-INF/classe If that is the case or if you prefer to keep the original artifact and attach the repackaged one with a different classifier, configure the plugin as shown in the following example: -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - repackage - - repackage - - - exec - - - - - - - +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] +---- +include::../maven/packaging/different-classifier-pom.xml[tags=different-classifier] ---- If you are using `spring-boot-starter-parent`, the `repackage` goal is executed automatically in an execution with id `repackage`. In that setup, only the configuration should be specified, as shown in the following example: -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - repackage - - exec - - - - - - - +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- +include::../maven/packaging/repackage-configuration-pom.xml[tags=repackage-configuration] +---- + This configuration will generate two artifacts: the original one and the repackaged counter part produced by the repackage goal. Both will be installed/deployed transparently. @@ -280,81 +158,18 @@ Both will be installed/deployed transparently. You can also use the same configuration if you want to repackage a secondary artifact the same way the main artifact is replaced. The following configuration installs/deploys a single `task` classified artifact with the repackaged application: -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - jar - - package - - task - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - repackage - - repackage - - - task - - - - - - - +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- +include::../maven/packaging/classified-artifact-pom.xml[tags=classified-artifact] +---- + As both the `maven-jar-plugin` and the `spring-boot-maven-plugin` runs at the same phase, it is important that the jar plugin is defined first (so that it runs before the repackage goal). Again, if you are using `spring-boot-starter-parent`, this can be simplified as follows: -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.apache.maven.plugins - maven-jar-plugin - - - default-jar - - task - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - repackage - - task - - - - - - - +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] +---- +include::../maven/packaging/classified-artifact-pom.xml[tags=classified-artifact] ---- @@ -363,27 +178,9 @@ Again, if you are using `spring-boot-starter-parent`, this can be simplified as ==== Custom Name If you need the repackaged jar to have a different local name than the one defined by the `artifactId` attribute of the project, use the standard `finalName`, as shown in the following example: -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - my-app - - - org.springframework.boot - spring-boot-maven-plugin - - - repackage - - repackage - - - - - - - +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] +---- +include::../maven/packaging/custom-name-pom.xml[tags=custom-name] ---- This configuration will generate the repackaged artifact in `target/my-app.jar`. @@ -395,29 +192,9 @@ This configuration will generate the repackaged artifact in `target/my-app.jar`. By default, the `repackage` goal replaces the original artifact with the executable one. If you need to only deploy the original jar and yet be able to run your app with the regular file name, configure the plugin as follows: -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - repackage - - repackage - - - false - - - - - - - +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] +---- +include::../maven/packaging/local-repackaged-artifact-pom.xml[tags=local-repackaged-artifact] ---- This configuration generates two artifacts: the original one and the executable counter part produced by the `repackage` goal. @@ -429,38 +206,9 @@ Only the original one will be installed/deployed. ==== Custom Layout Spring Boot repackages the jar file for this project using a custom layout factory defined in the additional jar file, provided as a dependency to the build plugin: -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - repackage - - repackage - - - - value - - - - - - - com.example - custom-layout - 0.0.1.BUILD-SNAPSHOT - - - - - - +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] +---- +include::../maven/packaging/custom-layout.xml[tags=custom-layout] ---- The layout factory is provided as an implementation of `LayoutFactory` (from `spring-boot-loader-tools`) explicitly specified in the pom. @@ -485,45 +233,16 @@ There are two ways one can exclude a dependency from being packaged/used at runt The following example excludes `com.foo:bar`, and only that artifact: -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - com.foo - bar - - - - - - - +[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: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - com.foo - - - - - +include::../maven/packaging/exclude-artifact-group-pom.xml[tags=exclude-artifact-group] ---- @@ -534,23 +253,9 @@ When a layered jar or war is created, the `spring-boot-jarmode-layertools` jar w With this jar on the classpath, you can launch your application in a special mode which allows the bootstrap code to run something entirely different from your application, for example, something that extracts the layers. If you wish to exclude this dependency, you can do so in the following manner: -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - false - - - - - - +include::../maven/packaging/exclude-dependency-pom.xml[tags=exclude-dependency] ---- @@ -561,35 +266,9 @@ The default setup splits dependencies into snapshot and non-snapshot, however, y For example, you may want to isolate company-specific dependencies of your project in a dedicated layer. The following `layers.xml` configuration shown one such setup: -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - org/springframework/boot/loader/** - - - - - - *:*:*SNAPSHOT - - - com.acme:* - - - - - dependencies - spring-boot-loader - snapshot-dependencies - company-dependencies - application - - +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] +---- +include::../maven/packaging/layers-configuration.xml[tags=layers-configuration] ---- The configuration above creates an additional `company-dependencies` layer with all libraries with the `com.acme` groupId. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/classified-artifact-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/classified-artifact-pom.xml new file mode 100644 index 000000000000..a6cfd32304da --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/classified-artifact-pom.xml @@ -0,0 +1,40 @@ + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + jar + + package + + task + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + repackage + + repackage + + + task + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/custom-layers-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/custom-layers-pom.xml new file mode 100644 index 000000000000..3a1af1c8d0d6 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/custom-layers-pom.xml @@ -0,0 +1,20 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + true + ${project.basedir}/src/layers.xml + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/custom-layout-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/custom-layout-pom.xml new file mode 100644 index 000000000000..3e751124f05a --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/custom-layout-pom.xml @@ -0,0 +1,34 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + repackage + + repackage + + + + value + + + + + + + com.example + custom-layout + 0.0.1.BUILD-SNAPSHOT + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/custom-name-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/custom-name-pom.xml new file mode 100644 index 000000000000..d37ba27d3b88 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/custom-name-pom.xml @@ -0,0 +1,23 @@ + + + + + my-app + + + org.springframework.boot + spring-boot-maven-plugin + + + repackage + + repackage + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/different-classifier-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/different-classifier-pom.xml new file mode 100644 index 000000000000..ec685d964d85 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/different-classifier-pom.xml @@ -0,0 +1,25 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + repackage + + repackage + + + exec + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/disable-layers-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/disable-layers-pom.xml new file mode 100644 index 000000000000..22d47df36b39 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/disable-layers-pom.xml @@ -0,0 +1,19 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + false + + + + + + + + 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 new file mode 100644 index 000000000000..1f69dbd0628e --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-artifact-group-pom.xml @@ -0,0 +1,17 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + com.foo + + + + + + + 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 new file mode 100644 index 000000000000..85ede9915c3c --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-artifact-pom.xml @@ -0,0 +1,22 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + com.foo + bar + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-dependency-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-dependency-pom.xml new file mode 100644 index 000000000000..511cc0086024 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/exclude-dependency-pom.xml @@ -0,0 +1,19 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + false + + + + + + + + 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 new file mode 100644 index 000000000000..1aa849fd0f58 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/jar-plugin-first-pom.xml @@ -0,0 +1,34 @@ + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + default-jar + + task + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + repackage + + task + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/layers-configuration.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/layers-configuration.xml new file mode 100644 index 000000000000..d2cc497dc88e --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/layers-configuration.xml @@ -0,0 +1,29 @@ + + + + + org/springframework/boot/loader/** + + + + + + *:*:*SNAPSHOT + + + com.acme:* + + + + + dependencies + spring-boot-loader + snapshot-dependencies + company-dependencies + application + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/layers.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/layers.xml new file mode 100644 index 000000000000..93cbee9272b8 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/layers.xml @@ -0,0 +1,28 @@ + + + + + org/springframework/boot/loader/** + + + + + + + + + *:*:*SNAPSHOT + + + + + dependencies + spring-boot-loader + snapshot-dependencies + application + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/local-repackaged-artifact-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/local-repackaged-artifact-pom.xml new file mode 100644 index 000000000000..137e455e245d --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/local-repackaged-artifact-pom.xml @@ -0,0 +1,25 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + repackage + + repackage + + + false + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/non-default-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/non-default-pom.xml new file mode 100644 index 000000000000..c21112400616 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/non-default-pom.xml @@ -0,0 +1,29 @@ + + + + 4.0.0 + getting-started + + + + + org.springframework.boot + spring-boot-maven-plugin + + ${start.class} + ZIP + + + + + repackage + + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/repackage-configuration-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/repackage-configuration-pom.xml new file mode 100644 index 000000000000..5878dbd5cab2 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/repackage-configuration-pom.xml @@ -0,0 +1,22 @@ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + repackage + + exec + + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/repackage-pom.xml similarity index 64% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/repackage-pom.xml index 6c2d900e60be..0de325fa3d62 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/repackage-pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 getting-started @@ -9,9 +9,16 @@ org.springframework.boot spring-boot-maven-plugin + + + + repackage + + + - + From 6f6a84b787917fce6170ace51ecf9cf85b026b9e Mon Sep 17 00:00:00 2001 From: robert-smith-911 Date: Sun, 7 Mar 2021 19:38:44 -0500 Subject: [PATCH 5/8] Fix build error by fixing name of included pom file --- .../spring-boot-maven-plugin/src/docs/asciidoc/packaging.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 cd50ddaa4e61..a37810df33ab 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 @@ -208,7 +208,7 @@ Spring Boot repackages the jar file for this project using a custom layout facto [source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- -include::../maven/packaging/custom-layout.xml[tags=custom-layout] +include::../maven/packaging/custom-layout-pom.xml[tags=custom-layout] ---- The layout factory is provided as an implementation of `LayoutFactory` (from `spring-boot-loader-tools`) explicitly specified in the pom. From 6ffe7b8133fe22993e0f043e22d4aa69a45245b9 Mon Sep 17 00:00:00 2001 From: robert-smith-911 Date: Sun, 7 Mar 2021 23:15:40 -0500 Subject: [PATCH 6/8] Fix using.adoc, pulling out xml snippets into separate pom files --- .../src/docs/asciidoc/using.adoc | 69 +++---------------- .../maven/using/default-and-override-pom.xml | 20 ++++++ .../maven/using/different-versions-pom.xml | 22 ++++++ ...arter-parent-override-dependencies-pom.xml | 43 ++++++++++++ .../maven/using/no-starter-parent-pom.xml | 30 ++++++++ 5 files changed, 123 insertions(+), 61 deletions(-) create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/default-and-override-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/different-versions-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/no-starter-parent-override-dependencies-pom.xml create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/no-starter-parent-pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/using.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/using.adoc index 330a076d8ba7..0ad9ba34ca73 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/using.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/using.adoc @@ -37,12 +37,9 @@ If you import additional starters, you can safely omit the version number. With that setup, you can also override individual dependencies by overriding a property in your own project. For instance, to use a different version of the SLF4J library and the Spring Data release train, you would add the following to your `pom.xml`: -[source,xml,indent=0,subs="verbatim,quotes,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - 1.7.30 - Moore-SR6 - +include::../maven/using/different-versions-pom.xml[tags=different-versions] ---- Browse the {version-properties-appendix}[`Dependency versions Appendix`] in the Spring Boot reference for a complete list of dependency version properties. @@ -56,53 +53,18 @@ You may have your own corporate standard parent that you need to use or you may If you do not want to use the `spring-boot-starter-parent`, you can still keep the benefit of the dependency management (but not the plugin management) by using an `import` scoped dependency, as follows: -[source,xml,indent=0,subs="verbatim,quotes,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.springframework.boot - spring-boot-dependencies - {gradle-project-version} - pom - import - - - +include::../maven/using/no-starter-parent-pom.xml[tags=no-starter-parent] ---- The preceding sample setup does not let you override individual dependencies by using properties, as explained above. To achieve the same result, you need to add entries in the `dependencyManagement` section of your project **before** the `spring-boot-dependencies` entry. For instance, to use a different version of the SLF4J library and the Spring Data release train, you could add the following elements to your `pom.xml`: -[source,xml,indent=0,subs="verbatim,quotes,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - - - org.slf4j - slf4j-api - 1.7.30 - - - - org.springframework.data - spring-data-releasetrain - 2020.0.0-SR1 - pom - import - - - org.springframework.boot - spring-boot-dependencies - {gradle-project-version} - pom - import - - - +include::../maven/using/no-starter-parent-override-dependencies-pom.xml[tags=no-starter-parent-override-dependencies] ---- @@ -120,24 +82,9 @@ For instance, you could tune the profiles to enable when running the application If you want to both have a default while allowing it to be overridden on the command-line, you should use a combination of a user-provided project property and MOJO configuration. -[source,xml,indent=0,subs="verbatim,attributes"] +[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] ---- - - - local,dev - - - - - org.springframework.boot - spring-boot-maven-plugin - - ${app.profiles} - - - - - +include::../maven/using/default-and-override-pom.xml[tags=default-and-override] ---- The above makes sure that `local` and `dev` are enabled by default. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/default-and-override-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/default-and-override-pom.xml new file mode 100644 index 000000000000..a317af82da22 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/default-and-override-pom.xml @@ -0,0 +1,20 @@ + + + + + local,dev + + + + + org.springframework.boot + spring-boot-maven-plugin + + ${app.profiles} + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/different-versions-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/different-versions-pom.xml new file mode 100644 index 000000000000..ec86e1c0048f --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/different-versions-pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + getting-started + + + + 1.7.30 + Moore-SR6 + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/no-starter-parent-override-dependencies-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/no-starter-parent-override-dependencies-pom.xml new file mode 100644 index 000000000000..577be603cadf --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/no-starter-parent-override-dependencies-pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + getting-started + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + + + + org.slf4j + slf4j-api + 1.7.30 + + + + org.springframework.data + spring-data-releasetrain + 2020.0.0-SR1 + pom + import + + + org.springframework.boot + spring-boot-dependencies + {gradle-project-version} + pom + import + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/no-starter-parent-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/no-starter-parent-pom.xml new file mode 100644 index 000000000000..02204826f400 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/no-starter-parent-pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + getting-started + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + + + + org.springframework.boot + spring-boot-dependencies + {gradle-project-version} + pom + import + + + + + + From fb63e6d41c12d42ddf079fbe987cd8cac53a7132 Mon Sep 17 00:00:00 2001 From: robert-smith-911 Date: Sun, 7 Mar 2021 23:20:44 -0500 Subject: [PATCH 7/8] Make artifactIds in pom files more consistent --- .../src/docs/maven/integration-tests/customize-jmx-port-pom.xml | 2 +- .../src/docs/maven/integration-tests/pom.xml | 2 +- .../src/docs/maven/integration-tests/random-port-pom.xml | 2 +- .../src/docs/maven/packaging/non-default-pom.xml | 2 +- .../src/docs/maven/packaging/repackage-pom.xml | 2 +- .../src/docs/maven/running/devtools-pom.xml | 2 +- .../src/docs/maven/using/no-starter-parent-pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/customize-jmx-port-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/customize-jmx-port-pom.xml index cf479e59f3ab..4c57c01bea43 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/customize-jmx-port-pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/customize-jmx-port-pom.xml @@ -1,7 +1,7 @@ 4.0.0 - build-info + integration-tests diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/pom.xml index 536ee8936d06..fdbbe349660d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/pom.xml @@ -1,7 +1,7 @@ 4.0.0 - build-info + integration-tests diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/random-port-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/random-port-pom.xml index 6aedaee9f995..202b30600e01 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/random-port-pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/integration-tests/random-port-pom.xml @@ -1,7 +1,7 @@ 4.0.0 - build-info + integration-tests diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/non-default-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/non-default-pom.xml index c21112400616..72cbcbebb4f6 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/non-default-pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/non-default-pom.xml @@ -2,7 +2,7 @@ 4.0.0 - getting-started + packaging 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 0de325fa3d62..c5401e60981d 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 @@ -2,7 +2,7 @@ 4.0.0 - getting-started + packaging diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/devtools-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/devtools-pom.xml index 172f51cc1b8b..222b96c2bdeb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/devtools-pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/running/devtools-pom.xml @@ -1,7 +1,7 @@ 4.0.0 - getting-started + running diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/no-starter-parent-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/no-starter-parent-pom.xml index 02204826f400..b5aaf8815d9d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/no-starter-parent-pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/using/no-starter-parent-pom.xml @@ -1,7 +1,7 @@ 4.0.0 - getting-started + using From 00b5cf1ccf46effe1e4760e3a1e9be188ad0f341 Mon Sep 17 00:00:00 2001 From: robert-smith-911 Date: Sun, 7 Mar 2021 23:44:14 -0500 Subject: [PATCH 8/8] Move tags in non-default-pom.xml to surround instead of Fix custom-image-name-pom.xml with proper image name instead of env info --- .../docs/maven/packaging-oci-image/custom-image-name-pom.xml | 5 +---- .../src/docs/maven/packaging/non-default-pom.xml | 5 ++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/custom-image-name-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/custom-image-name-pom.xml index 857a716e24c3..7a89363fe0eb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/custom-image-name-pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging-oci-image/custom-image-name-pom.xml @@ -8,10 +8,7 @@ spring-boot-maven-plugin - - http://proxy.example.com - https://proxy.example.com - + example.com/library/${project.artifactId} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/non-default-pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/non-default-pom.xml index 72cbcbebb4f6..ded8bc10bdd4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/non-default-pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/maven/packaging/non-default-pom.xml @@ -1,9 +1,9 @@ - 4.0.0 packaging + @@ -23,7 +23,6 @@ - + -