From 1d396abec5131baca2c30555b8c86b76070ea149 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 23 Jan 2020 13:50:22 +0000 Subject: [PATCH] Fix bootBuildImage integration tests on Java 13 We build with Java 8, 11, and 13 without specifying target compatibility for the bytecode of the app that's placed in the image. The built image uses Java 11 and when the app is built with Java 13 it fails to start as the Java 11 VM can't read that Java 13 bytecode. This commit configures the app that's placed in the image to be built with target compatibility of 1.8. This allows it to be compiled with all version of Java with which we build and to also be compatible with the JVM that's in the image. See gh-19831 --- .../tasks/bundling/BootBuildImageIntegrationTests.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.gradle index feb1992eeb..8971742147 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.gradle @@ -2,3 +2,6 @@ plugins { id 'java' id 'org.springframework.boot' version '{version}' } + +sourceCompatibility = '1.8' +targetCompatibility = '1.8'