|
21 | 21 | import java.io.InputStream;
|
22 | 22 | import java.nio.file.Files;
|
23 | 23 | import java.nio.file.Path;
|
| 24 | +import java.nio.file.StandardCopyOption; |
24 | 25 | import java.util.Arrays;
|
25 | 26 | import java.util.Collections;
|
26 | 27 | import java.util.List;
|
@@ -148,14 +149,13 @@ private void configureTestConventions(Project project) {
|
148 | 149 | withOptionalBuildJavaHome(project, (javaHome) -> test.setExecutable(javaHome + "/bin/java"));
|
149 | 150 | test.useJUnitPlatform();
|
150 | 151 | test.setMaxHeapSize("1024M");
|
151 |
| - CopyJdk8156584SecurityProperties copyJdk8156584SecurityProperties = new CopyJdk8156584SecurityProperties( |
152 |
| - project); |
153 | 152 | if (buildingWithJava8(project)) {
|
| 153 | + CopyJdk8156584SecurityProperties copyJdk8156584SecurityProperties = new CopyJdk8156584SecurityProperties( |
| 154 | + project); |
154 | 155 | test.systemProperty("java.security.properties",
|
155 | 156 | "file:" + test.getWorkingDir().toPath().relativize(copyJdk8156584SecurityProperties.output));
|
156 |
| - test.setDebug(true); |
| 157 | + test.doFirst(copyJdk8156584SecurityProperties); |
157 | 158 | }
|
158 |
| - test.doFirst(copyJdk8156584SecurityProperties); |
159 | 159 | });
|
160 | 160 | project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> project.getDependencies()
|
161 | 161 | .add(JavaPlugin.TEST_RUNTIME_ONLY_CONFIGURATION_NAME, "org.junit.platform:junit-platform-launcher"));
|
@@ -250,7 +250,7 @@ private CopyJdk8156584SecurityProperties(Project project) {
|
250 | 250 | public void execute(Task task) {
|
251 | 251 | try (InputStream input = getClass().getClassLoader()
|
252 | 252 | .getResourceAsStream(CopyJdk8156584SecurityProperties.SECURITY_PROPERTIES_FILE_NAME)) {
|
253 |
| - Files.copy(input, this.output); |
| 253 | + Files.copy(input, this.output, StandardCopyOption.REPLACE_EXISTING); |
254 | 254 | }
|
255 | 255 | catch (IOException ex) {
|
256 | 256 | throw new RuntimeException(ex);
|
|
0 commit comments