This is just a workaround you can try until someone comes up with a better answer. (I will remove it afterwards probably)
Instead of executing commands directly, you can create a bash/batch script and try to execute that. For example:
<execution>
<id>Some ID</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${basedir}/scripts/do_stuff.sh</executable>
</configuration>
</execution>
It's basically the same thing, but you can use the normal syntax in the script, instead of the XML syntax in the POM file.