Allow the project to be built with Java 16

See gh-25171
This commit is contained in:
dreis2211
2021-02-10 15:42:38 +01:00
committed by Andy Wilkinson
parent 181d0ee932
commit 1ccd8dae8a
9 changed files with 209 additions and 24 deletions

View File

@@ -10,6 +10,10 @@ plugins {
description = "Spring Boot Gradle Plugin"
toolchain {
maximumCompatibleJavaVersion = 15
}
configurations {
asciidoctorExtensions {
extendsFrom dependencyManagement

View File

@@ -69,7 +69,7 @@ processResources {
}
compileJava {
if ((!project.hasProperty("buildJavaHome")) && JavaVersion.current() == JavaVersion.VERSION_1_8) {
if ((!project.hasProperty("toolchainVersion")) && JavaVersion.current() == JavaVersion.VERSION_1_8) {
options.compilerArgs += ['-Xlint:-sunapi', '-XDenableSunApiLintControl']
}
}

View File

@@ -30,6 +30,8 @@ import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.junit.jupiter.api.condition.JRE;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.loader.tools.FileUtils;
@@ -247,6 +249,7 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests {
});
}
@DisabledForJreRange(min = JRE.JAVA_16) // Remove this once Kotlin supports Java 16
@TestTemplate
void whenAProjectUsesKotlinItsModuleMetadataIsRepackagedIntoBootInfClasses(MavenBuild mavenBuild) {
mavenBuild.project("jar-with-kotlin-module").execute((project) -> {