0

I use maven exec plugin and want to execute simple .exe file with an argument passed in, so the final command line execution would look like:

ISCC.exe setup.iss

I tried to use

<arguments>
   <argument>arg1</argument>
  ...
</arguments>

however it produced output that was not suitable for me:

ISCC.exe, arg1, arg2, arg3 

because I didnt want to have commas and wanted to have just spaces instead so decided to use <commandlineArgs>

and finally my build tag is as follows:

<build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.5.0</version>

                <executions>
                    <execution>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>install</phase>
                    </execution>
                </executions>
                <configuration>
                    <executable>ISCC.exe</executable>
                    <commandlineArgs>
                        setup.iss
                    </commandlineArgs>
                </configuration>
            </plugin>
        </plugins>
    </build>

but when I run maven, it produces the command line execution just as it was previously:

ISCC.exe, setup.iss

i.e. with comma instead of space

Could you please give a hint of how to fix this,

Cheers

Andrey Yaskulsky
  • 2,458
  • 9
  • 39
  • 81
  • I can't reproduce that with your exact config (using `java` as executable and `-version` as command-line arguments. How did you see that the plugin wanted to execute this command? If you run with `-X` switch, you'll see it in the logs (`[DEBUG] Executing command line:`). – Tunaki Jul 29 '16 at 17:34
  • @Tunaki I run maven with -X switch and it shown me the exact command, I suspect that problem here is because I use .exe file and the plugin for some reason works not as expected in this case – Andrey Yaskulsky Jul 29 '16 at 17:35
  • @Tunaki here is my log: Executing command line: [C:\jpk-inno-installer\ISCC.exe, jpksender.iss] – Andrey Yaskulsky Jul 29 '16 at 17:36
  • Aaah but that's normal! That's the output of the array of all the command. – Tunaki Jul 29 '16 at 17:39
  • @Tanuki, could you please give a hint how can I avoid this comma as I dont need it, my build fails because of it – Andrey Yaskulsky Jul 29 '16 at 17:39
  • This comma is NOT part of the executed command. What you see here is the result of `Arrays.toString` called with the array formed by the commands. `C:\jpk-inno-installer\ISCC.exe jpksender.iss` IS the command launched. – Tunaki Jul 29 '16 at 17:40

0 Answers0