From aa39c68964f41a34d36747e5b8def1b284fec40b Mon Sep 17 00:00:00 2001 From: lahoucine el addali Date: Tue, 6 Aug 2024 14:48:15 +0100 Subject: [PATCH] split build args correcltly --- .../maven/AbstractNativeImageMojo.java | 23 +++---------------- 1 file changed, 3 insertions(+), 20 deletions(-) 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..6504f5678 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,12 @@ protected List getBuildArgs() throws MojoExecutionException { if (buildArgs != null && !buildArgs.isEmpty()) { for (String buildArg : buildArgs) { - if(buildArg.startsWith("\\Q") || - buildArg.startsWith("-H:ConfigurationFileDirectories")) { + System.out.println(buildArg); + 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))); } }