Details
Description
The ForkedMavenExecutor assumes the mvn executable is on the command-line path. This will cause the release goals to fail if mvn is run from an explicit path and the PATH environment variable has not be set to contain a mvn executable. More dangerously though is the case where the release goal is started with an explicit mvn executable of one version (for instance 2.0.8) but a different version of the mvn executable is available on the PATH. The forked processes will run a different version of Maven2 that the parent process.
Issue Links
- duplicates
-
MRELEASE-428
ForkedMavenExecutor must use ${maven.home}/bin/mvn and not only mvn
-
Attached patch with test case. The patch uses the maven.home system property to find the mvn executable. I now understand that the original process can't spawn children with a different maven version since the mvn script checks that the M2_HOME environment variable is set and matches the version running.