From 6f8a0f4bee2869e19f42d76e77575f5630eac9f5 Mon Sep 17 00:00:00 2001 From: Ioannis Canellos Date: Mon, 25 Sep 2023 16:59:37 +0300 Subject: [PATCH] feat: QuarkusProdModeTest creates tmp dirs under build dir --- .../src/main/java/io/quarkus/test/QuarkusProdModeTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test-framework/junit5-internal/src/main/java/io/quarkus/test/QuarkusProdModeTest.java b/test-framework/junit5-internal/src/main/java/io/quarkus/test/QuarkusProdModeTest.java index f9c2110ceb1e4..f090691b62a58 100644 --- a/test-framework/junit5-internal/src/main/java/io/quarkus/test/QuarkusProdModeTest.java +++ b/test-framework/junit5-internal/src/main/java/io/quarkus/test/QuarkusProdModeTest.java @@ -392,7 +392,12 @@ public void close() throws Throwable { Class testClass = extensionContext.getRequiredTestClass(); try { - outputDir = Files.createTempDirectory("quarkus-prod-mode-test"); + Optional projectBuildDir = Optional.ofNullable(System.getProperty("project.build.directory")) //maven + .or(() -> Optional.ofNullable(System.getProperty("buildDir"))) //gradle + .map(Path::of); + + outputDir = projectBuildDir.isPresent() ? Files.createTempDirectory(projectBuildDir.get(), "quarkus-prod-mode-test") + : Files.createTempDirectory("quarkus-prod-mode-test"); Path deploymentDir = outputDir.resolve("deployment-result"); buildDir = outputDir.resolve("build-result");