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 4e18543a1f..d70cd032e7 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 @@ -102,7 +102,7 @@ This configuration will use a builder image with the name `mine/java-cnb-builder ==== 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_JAVA_VERSION` property (typically used to customize the JDK version the image should use): +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): [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 8a231c81c6..4fec7c4b99 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,6 +9,6 @@ bootJar { // tag::env[] bootBuildImage { - environment = ["BP_JAVA_VERSION" : "13.0.1"] + environment = ["BP_JVM_VERSION" : "13.0.1"] } // end::env[] 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 774268830a..f2446ecb34 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 @@ -11,6 +11,6 @@ tasks.getByName("bootJar") { // tag::env[] tasks.getByName("bootBuildImage") { - environment = ["BP_JAVA_VERSION" : "13.0.1"] + environment = ["BP_JVM_VERSION" : "13.0.1"] } // end::env[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImage.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImage.java index a8086658cf..efe91b3848 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImage.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImage.java @@ -51,7 +51,7 @@ import org.springframework.util.StringUtils; */ public class BootBuildImage extends DefaultTask { - private static final String OPENJDK_BUILDPACK_JAVA_VERSION_KEY = "BP_JAVA_VERSION"; + private static final String BUILDPACK_JVM_VERSION_KEY = "BP_JVM_VERSION"; private RegularFileProperty jar; @@ -246,8 +246,8 @@ public class BootBuildImage extends DefaultTask { if (this.environment != null && !this.environment.isEmpty()) { request = request.withEnv(this.environment); } - if (this.targetJavaVersion.isPresent() && !request.getEnv().containsKey(OPENJDK_BUILDPACK_JAVA_VERSION_KEY)) { - request = request.withEnv(OPENJDK_BUILDPACK_JAVA_VERSION_KEY, translateTargetJavaVersion()); + if (this.targetJavaVersion.isPresent() && !request.getEnv().containsKey(BUILDPACK_JVM_VERSION_KEY)) { + request = request.withEnv(BUILDPACK_JVM_VERSION_KEY, translateTargetJavaVersion()); } return request; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageTests.java index fc11ed7b14..986f62d273 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageTests.java @@ -131,15 +131,15 @@ class BootBuildImageTests { @Test void whenJavaVersionIsSetInEnvironmentItIsIncludedInTheRequest() { - this.buildImage.environment("BP_JAVA_VERSION", "from-env"); + this.buildImage.environment("BP_JVM_VERSION", "from-env"); this.buildImage.getTargetJavaVersion().set(JavaVersion.VERSION_1_8); - assertThat(this.buildImage.createRequest().getEnv()).containsEntry("BP_JAVA_VERSION", "from-env").hasSize(1); + assertThat(this.buildImage.createRequest().getEnv()).containsEntry("BP_JVM_VERSION", "from-env").hasSize(1); } @Test void whenTargetCompatibilityIsSetThenJavaVersionIsIncludedInTheRequest() { this.buildImage.getTargetJavaVersion().set(JavaVersion.VERSION_1_8); - assertThat(this.buildImage.createRequest().getEnv()).containsEntry("BP_JAVA_VERSION", "8.*").hasSize(1); + assertThat(this.buildImage.createRequest().getEnv()).containsEntry("BP_JVM_VERSION", "8.*").hasSize(1); } @Test @@ -147,7 +147,7 @@ class BootBuildImageTests { this.buildImage.environment("ALPHA", "a"); this.buildImage.getTargetJavaVersion().set(JavaVersion.VERSION_11); assertThat(this.buildImage.createRequest().getEnv()).containsEntry("ALPHA", "a") - .containsEntry("BP_JAVA_VERSION", "11.*").hasSize(2); + .containsEntry("BP_JVM_VERSION", "11.*").hasSize(2); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithBuilderError.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithBuilderError.gradle index 34d5b20508..21d528ff59 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithBuilderError.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithBuilderError.gradle @@ -7,5 +7,5 @@ sourceCompatibility = '1.8' targetCompatibility = '1.8' bootBuildImage { - environment = ["BP_JAVA_VERSION" : "13.9.9"] + environment = ["BP_JVM_VERSION" : "13.9.9"] } 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 89c6288b52..71ffd6adf5 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 @@ -146,7 +146,7 @@ The builder can be specified on the command line as well, as shown in this examp ==== 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_JAVA_VERSION` property (typically used to customize the JDK version the image should use): +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): [source,xml,indent=0,subs="verbatim,attributes"] ---- @@ -160,7 +160,7 @@ The following example assumes that the default builder defines a `BP_JAVA_VERSIO - 13.0.1 + 13.0.1 diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-image-builder-error/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-image-builder-error/pom.xml index 65183f0b92..5b7491e88e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-image-builder-error/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-image-builder-error/pom.xml @@ -24,7 +24,7 @@ - 13.9.9 + 13.9.9 diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/BuildImageMojo.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/BuildImageMojo.java index 16538f46a3..d678f23371 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/BuildImageMojo.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/BuildImageMojo.java @@ -63,7 +63,7 @@ import org.springframework.util.StringUtils; @Execute(phase = LifecyclePhase.PACKAGE) public class BuildImageMojo extends AbstractPackagerMojo { - private static final String OPENJDK_BUILDPACK_JAVA_VERSION_KEY = "BP_JAVA_VERSION"; + private static final String BUILDPACK_JVM_VERSION_KEY = "BP_JVM_VERSION"; /** * Directory containing the JAR. @@ -175,11 +175,11 @@ public class BuildImageMojo extends AbstractPackagerMojo { } private BuildRequest customizeEnvironment(BuildRequest request) { - if (!request.getEnv().containsKey(OPENJDK_BUILDPACK_JAVA_VERSION_KEY)) { + if (!request.getEnv().containsKey(BUILDPACK_JVM_VERSION_KEY)) { JavaCompilerPluginConfiguration compilerConfiguration = new JavaCompilerPluginConfiguration(this.project); String targetJavaVersion = compilerConfiguration.getTargetMajorVersion(); if (StringUtils.hasText(targetJavaVersion)) { - return request.withEnv(OPENJDK_BUILDPACK_JAVA_VERSION_KEY, targetJavaVersion + ".*"); + return request.withEnv(BUILDPACK_JVM_VERSION_KEY, targetJavaVersion + ".*"); } } return request;