Skip to content
Advertisement

Using Maven Exec Plugin inside Bash

I’m writing a bash script which will execute some part of a maven project. The script looks like this:

JavaScript

But this fails every time with the following error:

JavaScript

If I skip the CMD=... assignment, and just run the mvn part directly, like this…

JavaScript

…it works just fine.

How can I get maven and the exec plugin to understand that I have two arguments in the -Dexec.args section?

Advertisement

Answer

According to the docs exec:java has no exec.args? It does have exec.arguments which takes a String[] which would translate into:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement