Skip to content

Commit 3a3eb1b

Browse files
committed
Fix workaround for JDK-8156584
See gh-26252
1 parent ecd1e53 commit 3a3eb1b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.io.InputStream;
2222
import java.nio.file.Files;
2323
import java.nio.file.Path;
24+
import java.nio.file.StandardCopyOption;
2425
import java.util.Arrays;
2526
import java.util.Collections;
2627
import java.util.List;
@@ -148,14 +149,13 @@ private void configureTestConventions(Project project) {
148149
withOptionalBuildJavaHome(project, (javaHome) -> test.setExecutable(javaHome + "/bin/java"));
149150
test.useJUnitPlatform();
150151
test.setMaxHeapSize("1024M");
151-
CopyJdk8156584SecurityProperties copyJdk8156584SecurityProperties = new CopyJdk8156584SecurityProperties(
152-
project);
153152
if (buildingWithJava8(project)) {
153+
CopyJdk8156584SecurityProperties copyJdk8156584SecurityProperties = new CopyJdk8156584SecurityProperties(
154+
project);
154155
test.systemProperty("java.security.properties",
155156
"file:" + test.getWorkingDir().toPath().relativize(copyJdk8156584SecurityProperties.output));
156-
test.setDebug(true);
157+
test.doFirst(copyJdk8156584SecurityProperties);
157158
}
158-
test.doFirst(copyJdk8156584SecurityProperties);
159159
});
160160
project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> project.getDependencies()
161161
.add(JavaPlugin.TEST_RUNTIME_ONLY_CONFIGURATION_NAME, "org.junit.platform:junit-platform-launcher"));
@@ -250,7 +250,7 @@ private CopyJdk8156584SecurityProperties(Project project) {
250250
public void execute(Task task) {
251251
try (InputStream input = getClass().getClassLoader()
252252
.getResourceAsStream(CopyJdk8156584SecurityProperties.SECURITY_PROPERTIES_FILE_NAME)) {
253-
Files.copy(input, this.output);
253+
Files.copy(input, this.output, StandardCopyOption.REPLACE_EXISTING);
254254
}
255255
catch (IOException ex) {
256256
throw new RuntimeException(ex);

0 commit comments

Comments
 (0)