Description
The bin/mvn script of the 3.x line converts MAVEN_PROJECTBASEDIR to Windows format only for Cygwin:
# For Cygwin, switch project base directory path to Windows format before
# executing Maven otherwise this will cause Maven not to consider it.
if $cygwin ; then
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
Under MinGW (e.g., Git Bash, used by shell: bash steps on GitHub Actions Windows runners) the POSIX path falls through to exec java "-Dmaven.multiModuleProjectDirectory=/d/a/...", where the MSYS2 argument conversion rewrites it to the mixed form D:/a/... with forward slashes.
While / and \ are equivalent for the Win32 API, the mixed form breaks some applications and plugins. Passing the canonical representation of Windows paths to the JVM would prevent this class of problem.
The main branch already handles MinGW like Cygwin since #7958 (merged via #520, released in 4.0.0-alpha-2); this is safe because MSYS2 ships cygpath. Please consider backporting that change to the 3.x line.
Context
Currently due to a bug in Apache RAT 0.17-0.18 (fixed by RAT-559, not yet released), we can not use ${maven.multiModuleProjectDirectory}/.rat-excludes as the location of the exclusion file. The bug is of course in Apache RAT, but since Maven 4.x already handles MinGW and Cygwin alike, backporting the patch would work around the problem.
Description
The
bin/mvnscript of the 3.x line convertsMAVEN_PROJECTBASEDIRto Windows format only for Cygwin:Under MinGW (e.g., Git Bash, used by
shell: bashsteps on GitHub Actions Windows runners) the POSIX path falls through toexec java "-Dmaven.multiModuleProjectDirectory=/d/a/...", where the MSYS2 argument conversion rewrites it to the mixed formD:/a/...with forward slashes.While
/and\are equivalent for the Win32 API, the mixed form breaks some applications and plugins. Passing the canonical representation of Windows paths to the JVM would prevent this class of problem.The
mainbranch already handles MinGW like Cygwin since #7958 (merged via #520, released in 4.0.0-alpha-2); this is safe because MSYS2 shipscygpath. Please consider backporting that change to the 3.x line.Context
Currently due to a bug in Apache RAT
0.17-0.18(fixed by RAT-559, not yet released), we can not use${maven.multiModuleProjectDirectory}/.rat-excludesas the location of the exclusion file. The bug is of course in Apache RAT, but since Maven 4.x already handles MinGW and Cygwin alike, backporting the patch would work around the problem.