diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/AbstractNativeImageMojo.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/AbstractNativeImageMojo.java index c05e2f37e..339ae4a3a 100644 --- a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/AbstractNativeImageMojo.java +++ b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/AbstractNativeImageMojo.java @@ -243,29 +243,11 @@ protected List getBuildArgs() throws MojoExecutionException { if (buildArgs != null && !buildArgs.isEmpty()) { for (String buildArg : buildArgs) { - if(buildArg.startsWith("\\Q") || - buildArg.startsWith("-H:ConfigurationFileDirectories")) { + if(buildArg.startsWith("\\Q") || buildArg.startsWith("-H")) { cliArgs.add(buildArg); continue; } - String[] args = buildArg.split("\\s+"); - int i=0; - while(i < args.length) { - String a =args[i]; - if (a.charAt(0) == System.getProperty("user.home").charAt(0)) { - StringBuilder path = new StringBuilder(a); - i++; - while( i< args.length && args[i].toLowerCase().charAt(0) <= 'z' && - args[i].toLowerCase().charAt(0) >= 'a') { - path.append(" ").append(args[i]); - i++; - } - cliArgs.add(path.toString()); - } else { - cliArgs.add(a); - i++; - } - } + cliArgs.addAll(Arrays.asList(buildArg.split("\\s+", 2))); } } diff --git a/native-maven-plugin/src/testFixtures/groovy/org/graalvm/buildtools/maven/AbstractGraalVMMavenFunctionalTest.groovy b/native-maven-plugin/src/testFixtures/groovy/org/graalvm/buildtools/maven/AbstractGraalVMMavenFunctionalTest.groovy index 8bd27d470..eea14f561 100644 --- a/native-maven-plugin/src/testFixtures/groovy/org/graalvm/buildtools/maven/AbstractGraalVMMavenFunctionalTest.groovy +++ b/native-maven-plugin/src/testFixtures/groovy/org/graalvm/buildtools/maven/AbstractGraalVMMavenFunctionalTest.groovy @@ -74,8 +74,8 @@ abstract class AbstractGraalVMMavenFunctionalTest extends Specification { boolean IS_MAC = System.getProperty("os.name", "unknown").contains("Mac"); def setup() { - var home_dir = Path.of(System.getProperty("user.home")) - testDirectory = home_dir.resolve("tests") + Path HomeDir = Path.of(System.getProperty("user.home")) + testDirectory = HomeDir.resolve("tests") if (Files.notExists(testDirectory)) { Files.createDirectory(testDirectory) @@ -89,8 +89,6 @@ abstract class AbstractGraalVMMavenFunctionalTest extends Specification { } def cleanup() { - - //cleanup test directory and all it's sub directories Files.walkFileTree(testDirectory, new SimpleFileVisitor() { @Override FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {