From 32c184e31cc2965087d2d1c1be80d1c499a692c9 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 17 Aug 2021 17:46:19 +0100 Subject: [PATCH] Revert changes made to work around JDK-8156584 Closes gh-26848 --- .../boot/build/JavaConventions.java | 38 ------------------- .../resources/jdk-8156584-security.properties | 1 - 2 files changed, 39 deletions(-) delete mode 100644 buildSrc/src/main/resources/jdk-8156584-security.properties diff --git a/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java b/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java index fa506bc23d..91ffe1eaa1 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java @@ -16,12 +16,6 @@ package org.springframework.boot.build; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -33,10 +27,8 @@ import java.util.stream.Collectors; import io.spring.javaformat.gradle.CheckTask; import io.spring.javaformat.gradle.FormatTask; import io.spring.javaformat.gradle.SpringJavaFormatPlugin; -import org.gradle.api.Action; import org.gradle.api.JavaVersion; import org.gradle.api.Project; -import org.gradle.api.Task; import org.gradle.api.artifacts.Configuration; import org.gradle.api.artifacts.ConfigurationContainer; import org.gradle.api.artifacts.Dependency; @@ -164,13 +156,6 @@ class JavaConventions { project.getTasks().withType(Test.class, (test) -> { test.useJUnitPlatform(); test.setMaxHeapSize("1024M"); - if (buildingWithJava8(project)) { - CopyJdk8156584SecurityProperties copyJdk8156584SecurityProperties = new CopyJdk8156584SecurityProperties( - project); - test.systemProperty("java.security.properties", - "file:" + test.getWorkingDir().toPath().relativize(copyJdk8156584SecurityProperties.output)); - test.doFirst(copyJdk8156584SecurityProperties); - } project.getTasks().withType(Checkstyle.class, (checkstyle) -> test.mustRunAfter(checkstyle)); project.getTasks().withType(CheckTask.class, (checkFormat) -> test.mustRunAfter(checkFormat)); }); @@ -254,27 +239,4 @@ class JavaConventions { project.getPlugins().apply(ToolchainPlugin.class); } - private static final class CopyJdk8156584SecurityProperties implements Action { - - private static final String SECURITY_PROPERTIES_FILE_NAME = "jdk-8156584-security.properties"; - - private final Path output; - - private CopyJdk8156584SecurityProperties(Project project) { - this.output = new File(project.getBuildDir(), SECURITY_PROPERTIES_FILE_NAME).toPath(); - } - - @Override - public void execute(Task task) { - try (InputStream input = getClass().getClassLoader() - .getResourceAsStream(CopyJdk8156584SecurityProperties.SECURITY_PROPERTIES_FILE_NAME)) { - Files.copy(input, this.output, StandardCopyOption.REPLACE_EXISTING); - } - catch (IOException ex) { - throw new RuntimeException(ex); - } - } - - } - } diff --git a/buildSrc/src/main/resources/jdk-8156584-security.properties b/buildSrc/src/main/resources/jdk-8156584-security.properties deleted file mode 100644 index 2d72ee6c44..0000000000 --- a/buildSrc/src/main/resources/jdk-8156584-security.properties +++ /dev/null @@ -1 +0,0 @@ -keystore.pkcs12.keyProtectionAlgorithm=PBEWithHmacSHA256AndAES_256 \ No newline at end of file