From 005ed8b8db7b8fd27e7845f8986c344a9e1f2a0e Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Wed, 12 Aug 2020 17:04:17 -0500 Subject: [PATCH] Use Java version wildcard in image building docs Fixes gh-22916 --- .../src/docs/asciidoc/packaging-oci-image.adoc | 3 ++- .../src/docs/gradle/packaging/boot-build-image-env.gradle | 4 ++-- .../docs/gradle/packaging/boot-build-image-env.gradle.kts | 2 +- .../src/docs/asciidoc/packaging-oci-image.adoc | 5 +++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc index f98a6d6733e5..49401034a470 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc @@ -115,7 +115,8 @@ $ gradle bootBuildImage --builder=mine/java-cnb-builder --runImage=mine/java-cnb ==== Builder Configuration If the builder exposes configuration options, those can be set using the `environment` property. -The following example assumes that the default builder defines a `BP_JVM_VERSION` property (typically used to customize the JDK version the image should use): +The following example assumes that the default builder recognizes a `BP_JVM_VERSION` property. +This property is typically used to customize the JDK version the image should use by specifying the major version and a wildcard for the rest of the version: [source,groovy,indent=0,subs="verbatim,attributes",role="primary"] .Groovy diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle index e349bcc522c1..4d3f11545bcf 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle @@ -9,12 +9,12 @@ bootJar { // tag::env[] bootBuildImage { - environment = ["BP_JVM_VERSION" : "13.0.1"] + environment = ["BP_JVM_VERSION" : "8.*"] } // end::env[] task bootBuildImageEnvironment { doFirst { - bootBuildImage.environment.each { name, value -> println "$name=$value" } + bootBuildImage.environment.each { name, value -> println "$name=$value" } } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle.kts index faf5ccc21df9..488e56830de7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle.kts @@ -7,7 +7,7 @@ plugins { // tag::env[] tasks.getByName("bootBuildImage") { - environment = mapOf("BP_JVM_VERSION" to "13.0.1") + environment = mapOf("BP_JVM_VERSION" to "8.*") } // end::env[] 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 744d6592efb1..c899c58d6db1 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 @@ -152,7 +152,8 @@ The builder and run image can be specified on the command line as well, as shown ==== Builder Configuration If the builder exposes configuration options using environment variables, those can be set using the `env` attributes. -The following example assumes that the default builder defines a `BP_JVM_VERSION` property (typically used to customize the JDK version the image should use): +The following example assumes that the default builder recognizes a `BP_JVM_VERSION` property. +This property is typically used to customize the JDK version the image should use by specifying the major version and a wildcard for the rest of the version: [source,xml,indent=0,subs="verbatim,attributes"] ---- @@ -166,7 +167,7 @@ The following example assumes that the default builder defines a `BP_JVM_VERSION - 13.0.1 + 8.*