From eb11f64db7be38daf7ce685cfa6740de9ace2099 Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Mon, 4 Jan 2021 17:38:50 +0100 Subject: [PATCH] Yet another workaround for #281 --- .../mvnd/builder/DependencyGraph.java | 4 +-- integration-tests/pom.xml | 2 ++ .../mvnd/junit/MvndTestExtension.java | 28 ++++++++++++------- pom.xml | 3 +- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java index 5d6e67dd..d185c4f1 100644 --- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java +++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java @@ -375,8 +375,8 @@ public class DependencyGraph { * Compute the set of nodes reachable from the given {@code node} through the {@code is upstream of} relation. The * {@code node} itself is not a part of the returned set. * - * @param node the node for which the transitive upstream should be computed - * @return the set of transitive upstreams + * @param node the node for which the transitive upstream should be computed + * @return the set of transitive upstreams */ Set transitiveUpstreams(K node) { Set result = transitiveUpstreams.get(node); diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index f13f4e45..e7c7358a 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -89,6 +89,7 @@ ${os.detected.arch} ${settings.localRepository} ${surefire.version} + ${junit-platform-launcher.version} @@ -172,6 +173,7 @@ ${os.detected.arch} ${settings.localRepository} ${surefire.version} + ${junit-platform-launcher.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 dfb9eec9..77862bd9 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 @@ -230,20 +230,28 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback, 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 Path hostLocalMavenRepo = Paths.get(System.getProperty("mvnd.test.hostLocalMavenRepo")); Stream.of( - "org/apache/maven/surefire/surefire-providers/" + surefireVersion + "/surefire-providers-" - + surefireVersion + ".pom", - "org/apache/maven/surefire/surefire-providers/" + surefireVersion + "/surefire-providers-" - + surefireVersion + ".pom.sha1") + "org/apache/maven/surefire/surefire-providers/" + surefireVersion, + "org/junit/platform/junit-platform-launcher/" + junitPlatformLauncherVersion) .forEach(relPath -> { final Path src = hostLocalMavenRepo.resolve(relPath); - final Path dest = localMavenRepository.resolve(relPath); - try { - Files.createDirectories(dest.getParent()); - Files.copy(src, dest); - } catch (IOException e) { - throw new UncheckedIOException(e); + if (Files.isDirectory(src)) { + try (Stream files = Files.list(src)) { + files.forEach(file -> { + final Path dest = localMavenRepository.resolve(relPath).resolve(file.getFileName()); + try { + Files.createDirectories(dest.getParent()); + Files.copy(src, dest); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + + }); + } catch (IOException e) { + throw new UncheckedIOException(e); + } } }); } diff --git a/pom.xml b/pom.xml index 07a11a6b..0377ae19 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,8 @@ 3.2.0 2.4 1.2.0 - 2.22.2 + 2.22.2 + 1.3.1 1.13.9 1.0.15