|
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;
|
@@ -154,14 +155,13 @@ private void configureTestConventions(Project project) {
|
154 | 155 | project.getTasks().withType(Test.class, (test) -> {
|
155 | 156 | test.useJUnitPlatform();
|
156 | 157 | test.setMaxHeapSize("1024M");
|
157 |
| - CopyJdk8156584SecurityProperties copyJdk8156584SecurityProperties = new CopyJdk8156584SecurityProperties( |
158 |
| - project); |
159 | 158 | if (buildingWithJava8(project)) {
|
| 159 | + CopyJdk8156584SecurityProperties copyJdk8156584SecurityProperties = new CopyJdk8156584SecurityProperties( |
| 160 | + project); |
160 | 161 | test.systemProperty("java.security.properties",
|
161 | 162 | "file:" + test.getWorkingDir().toPath().relativize(copyJdk8156584SecurityProperties.output));
|
162 |
| - test.setDebug(true); |
| 163 | + test.doFirst(copyJdk8156584SecurityProperties); |
163 | 164 | }
|
164 |
| - test.doFirst(copyJdk8156584SecurityProperties); |
165 | 165 | });
|
166 | 166 | project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> project.getDependencies()
|
167 | 167 | .add(JavaPlugin.TEST_RUNTIME_ONLY_CONFIGURATION_NAME, "org.junit.platform:junit-platform-launcher"));
|
@@ -251,7 +251,7 @@ private CopyJdk8156584SecurityProperties(Project project) {
|
251 | 251 | public void execute(Task task) {
|
252 | 252 | try (InputStream input = getClass().getClassLoader()
|
253 | 253 | .getResourceAsStream(CopyJdk8156584SecurityProperties.SECURITY_PROPERTIES_FILE_NAME)) {
|
254 |
| - Files.copy(input, this.output); |
| 254 | + Files.copy(input, this.output, StandardCopyOption.REPLACE_EXISTING); |
255 | 255 | }
|
256 | 256 | catch (IOException ex) {
|
257 | 257 | throw new RuntimeException(ex);
|
|
0 commit comments