From 0014b6411ffa2ca813c4956a2564b195e5a54622 Mon Sep 17 00:00:00 2001 From: Konstantin Gribov Date: Sun, 16 Apr 2023 08:41:08 +0300 Subject: [PATCH] Allow overwriting resource files in TestResourcesInBuildStepsTest Signed-off-by: Konstantin Gribov --- .../main/java/org/acme/ext/deployment/AcmeExtProcessor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/integration-tests/gradle/src/main/resources/test-resources-in-build-steps/deployment/src/main/java/org/acme/ext/deployment/AcmeExtProcessor.java b/integration-tests/gradle/src/main/resources/test-resources-in-build-steps/deployment/src/main/java/org/acme/ext/deployment/AcmeExtProcessor.java index 18b2bc4bfdc29..44cee1ad30eab 100644 --- a/integration-tests/gradle/src/main/resources/test-resources-in-build-steps/deployment/src/main/java/org/acme/ext/deployment/AcmeExtProcessor.java +++ b/integration-tests/gradle/src/main/resources/test-resources-in-build-steps/deployment/src/main/java/org/acme/ext/deployment/AcmeExtProcessor.java @@ -8,6 +8,7 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.StandardCopyOption; class AcmeExtProcessor { @@ -23,9 +24,9 @@ FeatureBuildItem feature(ApplicationArchivesBuildItem appArchivesBuildItem, final Path output = p.getParent().getParent().getParent().resolve(launchModeBuildItem.getLaunchMode() + "-" + p.getFileName()); try { - Files.copy(p, output); + Files.copy(p, output, StandardCopyOption.REPLACE_EXISTING); } catch(IOException e) { - throw new IllegalStateException("Failed to copy " + p + " to " + output); + throw new IllegalStateException("Failed to copy " + p + " to " + output, e); } return new FeatureBuildItem(FEATURE); }