From 922403171e30e9cd38356766987adb689666a4d1 Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Fri, 14 Aug 2020 10:19:55 +0200 Subject: [PATCH] Include mvnd native client in the distro --- daemon/pom.xml | 4 ++++ daemon/src/main/distro/bin/{mvnd => mvnd.sh} | 0 daemon/src/main/provisio/maven-distro.xml | 17 +++++++++----- integration-tests/pom.xml | 20 +++-------------- .../fuse/mvnd/junit/MvndTestExtension.java | 8 +++++-- pom.xml | 22 +++++++++++++++++++ 6 files changed, 46 insertions(+), 25 deletions(-) rename daemon/src/main/distro/bin/{mvnd => mvnd.sh} (100%) diff --git a/daemon/pom.xml b/daemon/pom.xml index 7592b0bb..6c9c6381 100644 --- a/daemon/pom.xml +++ b/daemon/pom.xml @@ -30,6 +30,10 @@ jar Maven Daemon + + ${os.arch} + + org.jboss.fuse.mvnd diff --git a/daemon/src/main/distro/bin/mvnd b/daemon/src/main/distro/bin/mvnd.sh similarity index 100% rename from daemon/src/main/distro/bin/mvnd rename to daemon/src/main/distro/bin/mvnd.sh diff --git a/daemon/src/main/provisio/maven-distro.xml b/daemon/src/main/provisio/maven-distro.xml index 9951820b..991d36d4 100644 --- a/daemon/src/main/provisio/maven-distro.xml +++ b/daemon/src/main/provisio/maven-distro.xml @@ -17,23 +17,28 @@ --> - + + excludes="lib/slf4j*,conf/logging/*,lib/maven-slf4j-provider*,bin/mvn*"/> - + - + + + + mvnd + mvnd.exe + + - + diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index d0844082..53a89532 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -30,7 +30,7 @@ Maven Daemon - Integration Tests - ${project.basedir}/../client/target/mvnd + ${project.basedir}/../daemon/target/maven-distro/mvnd-${project.version}-${os.detected.name}-${os.arch} @@ -74,8 +74,7 @@ ${project.version} - ${project.basedir}/../daemon/target/maven-distro - ${project.basedir}/../daemon/target/mvnd-dist-${project.version}.zip + ${mvnd.home} @@ -83,17 +82,6 @@ - - windows - - - windows - - - - ${project.basedir}/../client/target/mvnd.exe - - native @@ -110,9 +98,7 @@ ${project.version} - ${project.basedir}/../daemon/target/maven-distro - ${mvnd.native.executable} - ${project.basedir}/../daemon/target/mvnd-dist-${project.version}.zip + ${mvnd.home} diff --git a/integration-tests/src/test/java/org/jboss/fuse/mvnd/junit/MvndTestExtension.java b/integration-tests/src/test/java/org/jboss/fuse/mvnd/junit/MvndTestExtension.java index c29f7663..17e15e84 100644 --- a/integration-tests/src/test/java/org/jboss/fuse/mvnd/junit/MvndTestExtension.java +++ b/integration-tests/src/test/java/org/jboss/fuse/mvnd/junit/MvndTestExtension.java @@ -97,7 +97,10 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback, f.set(testInstance, resource.layout); } else if (f.getType() == Client.class) { if (resource.isNative) { - final Path mvndNativeExecutablePath = Paths.get(System.getProperty("mvnd.native.executable")) + final Path mvndNativeExecutablePath = resource.layout.mavenHome().resolve( + System.getProperty("os.name").toLowerCase().contains("windows") + ? "bin/mvnd.exe" + : "bin/mvnd") .toAbsolutePath().normalize(); if (!Files.isRegularFile(mvndNativeExecutablePath)) { throw new IllegalStateException("mvnd executable does not exist: " + mvndNativeExecutablePath); @@ -176,7 +179,8 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback, .normalize().toAbsolutePath(); if (!Files.isDirectory(mvndHome)) { throw new IllegalStateException( - "The value of mvnd.home system property points at a path that does not exist or is not a directory"); + "The value of mvnd.home system property points at a path that does not exist or is not a directory: " + + mvndHome); } final Path mvndPropertiesPath = testDir.resolve("mvnd.properties"); final Path localMavenRepository = deleteDir(testDir.resolve("local-maven-repo")); diff --git a/pom.xml b/pom.xml index 44498ddb..dae32c59 100644 --- a/pom.xml +++ b/pom.xml @@ -50,6 +50,8 @@ 3.8.1 2.12.1 + 2.1.1 + 3.0.4 1.4.1 3.0 1.2.0 @@ -286,6 +288,26 @@ limitations under the License. maven-surefire-plugin ${surefire.version} + + org.codehaus.gmaven + groovy-maven-plugin + ${groovy-maven-plugin.version} + + + org.codehaus.groovy + groovy-all + ${groovy.version} + pom + + + + org.codehaus.groovy + groovy-testng + + + + + org.codehaus.mojo mrm-maven-plugin