I have a build in TeamCity that runs bash using exec-maven-plugin
and it runs a script and should take 4 arguments, 2 of them I provide from pom and 2 should come from TeamCity environment.
I am using following command line parameters in TeamCity build:
-DpreparationGoals=verify -Darguments='-Dfoo=1 -Dbar=2'
And following POM:
<execution>
<id>Native</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bash</executable>
<arguments>
<argument>scripts/run_script.sh</argument>
<argument>${version}</argument>
<argument>${version.Native}</argument>
<argument>${foo}</argument>
<argument>${bar}</argument>
</arguments>
</configuration>
</execution>
It manages to resolve first argument but it passes the whole rest of arguments string as first argument and second is left unresolved:
[DEBUG] Executing command line: [bash, scripts/run_script.sh, 1.2, 2.4, 1 -Dbar=2]
I tried to replace single quotes in Maven command line parameters with double it didn't work, was complaining about unbalanced quotes.