On macOS the following configuration results in an error.
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<skip>${skip.saving.reports}</skip>
</configuration>
<executions>
<execution>
<id>save_reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>ls</executable>
<arguments>
<argument>src/*</argument>
</arguments>
<outputFile>out.log</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
$ cat out.log
ls: src/*: No such file or directory
This is despite the fact that the directory exists and is non-empty on my system:
$ ls src/*
src/main:
java resources
src/test:
resources
To further illustrate the problem, trying to echo $SHELL will output "$SHELL" rather than expanding the variable.
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>echo</executable>
<arguments>
<argument>$SHELL</argument>
</arguments>
<outputFile>out.log</outputFile>
</configuration>
I haven't checked any of the plugin's code but my suspicion is that the arguments are quoted which prevents the shell from expanding them.
On macOS the following configuration results in an error.
This is despite the fact that the directory exists and is non-empty on my system:
To further illustrate the problem, trying to
echo $SHELLwill output "$SHELL" rather than expanding the variable.I haven't checked any of the plugin's code but my suspicion is that the arguments are quoted which prevents the shell from expanding them.