From af7388466f57aca25254e270c0d7b6e5eaa59d88 Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Thu, 7 Jan 2021 11:31:58 +0100 Subject: [PATCH] One more attempt to workaround #281 --- integration-tests/pom.xml | 19 +++++++++++++++---- .../mvnd/junit/MvndTestExtension.java | 10 ++++------ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index 6a8adf529..043200d95 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -88,8 +88,14 @@ ${os.detected.name} ${os.detected.arch} ${settings.localRepository} - ${surefire.version} - ${junit-platform-launcher.version} + + org/apache/maven/surefire/surefire-providers/${surefire.version} + org/apache/maven/surefire/surefire-junit-platform/${surefire.version} + org/junit/platform/junit-platform-launcher/${junit-platform-launcher.version} + org/junit/platform/junit-platform-engine/${junit-platform-launcher.version} + org/junit/jupiter/junit-jupiter/${junit.jupiter.version} + org/junit/jupiter/junit-jupiter-api/${junit.jupiter.version} + @@ -172,8 +178,13 @@ ${os.detected.name} ${os.detected.arch} ${settings.localRepository} - ${surefire.version} - ${junit-platform-launcher.version} + + org/apache/maven/surefire/surefire-providers/${surefire.version} + org/junit/platform/junit-platform-launcher/${junit-platform-launcher.version} + org/junit/platform/junit-platform-engine/${junit-platform-launcher.version} + org/junit/jupiter/junit-jupiter/${junit.jupiter.version} + org/junit/jupiter/junit-jupiter-api/${junit.jupiter.version} + diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTestExtension.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTestExtension.java index 77862bd91..c07186892 100644 --- a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTestExtension.java +++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTestExtension.java @@ -229,12 +229,10 @@ public static MvndResource create(String className, String rawProjectDir, boolea private static void prefillLocalRepo(final Path localMavenRepository) { /* Workaround for https://github.com/mvndaemon/mvnd/issues/281 */ - final String surefireVersion = System.getProperty("surefire.version"); - final String junitPlatformLauncherVersion = System.getProperty("junit-platform-launcher.version"); + final String preinstallArtifacts = System.getProperty("preinstall.artifacts").trim(); final Path hostLocalMavenRepo = Paths.get(System.getProperty("mvnd.test.hostLocalMavenRepo")); - Stream.of( - "org/apache/maven/surefire/surefire-providers/" + surefireVersion, - "org/junit/platform/junit-platform-launcher/" + junitPlatformLauncherVersion) + + Stream.of(preinstallArtifacts.split("[\\s,]+")) .forEach(relPath -> { final Path src = hostLocalMavenRepo.resolve(relPath); if (Files.isDirectory(src)) { @@ -243,7 +241,7 @@ private static void prefillLocalRepo(final Path localMavenRepository) { final Path dest = localMavenRepository.resolve(relPath).resolve(file.getFileName()); try { Files.createDirectories(dest.getParent()); - Files.copy(src, dest); + Files.copy(file, dest); } catch (IOException e) { throw new UncheckedIOException(e); }