Let mvnd -v show os name and arch

This commit is contained in:
Peter Palaga
2020-08-15 08:48:39 +02:00
parent d335f0db37
commit 28d0765667
9 changed files with 51 additions and 9 deletions

View File

@@ -87,6 +87,8 @@
<systemPropertyVariables>
<project.version>${project.version}</project.version>
<mvnd.home>${mvnd.home}</mvnd.home>
<os.detected.name>${os.detected.name}</os.detected.name>
<os.detected.arch>${os.detected.arch}</os.detected.arch>
</systemPropertyVariables>
</configuration>
</plugin>
@@ -111,6 +113,8 @@
<systemPropertyVariables>
<project.version>${project.version}</project.version>
<mvnd.home>${mvnd.home}</mvnd.home>
<os.detected.name>${os.detected.name}</os.detected.name>
<os.detected.arch>${os.detected.arch}</os.detected.arch>
</systemPropertyVariables>
</configuration>
</execution>

View File

@@ -48,7 +48,11 @@ public class VersionNativeIT {
Assertions.assertThat(logMessage.getAllValues())
.is(new MatchInOrderAmongOthers<>(
"\\QMaven Daemon " + System.getProperty("project.version") + "\\E",
"\\QMaven Daemon "
+ System.getProperty("project.version")
+ "-" + System.getProperty("os.detected.name")
+ "-" + System.getProperty("os.detected.arch")
+ "\\E",
"\\QMaven home: " + layout.mavenHome() + "\\E"));
}
}

View File

@@ -23,6 +23,7 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.stream.Stream;
import org.jboss.fuse.mvnd.client.Client;
@@ -98,7 +99,7 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
} else if (f.getType() == Client.class) {
if (resource.isNative) {
final Path mvndNativeExecutablePath = resource.layout.mavenHome().resolve(
System.getProperty("os.name").toLowerCase().contains("windows")
System.getProperty("os.name").toLowerCase(Locale.ROOT).startsWith("windows")
? "bin/mvnd.exe"
: "bin/mvnd")
.toAbsolutePath().normalize();