How to inherit the current path when invoking Maven's exec-maven-plugin?
- by wishihadabettername
I have an <exec-maven-plugin> which calls an external command (in this case, svnversion). The command is in the path for the current user.
However, when a separate shell is spawned by the plugin, the path is not initialized. I don't want to hardcode or define a variable for each external command (there would be too much to maintain, especially that there are both Windows and *nix users).
My pom.xml contains the following:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>svnversion-exec</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>svnversion</executable>
<arguments>
<argument><![CDATA[ >version.txt ]]></argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
Currently I get the following output:
[INFO] [exec:exec {execution: svnversion-exec}] 'svnversion' is not recognized as an internal or external command, operable program or batch file.
[ERROR] BUILD ERROR: Result of cmd.exe /X /C "svnversion >version.txt" execution is: '1'.
Thank you!