choksi2212 commented on code in PR #13429: URL: https://github.com/apache/maven/pull/13429#discussion_r4247006956
########## apache-maven/src/bin/mvn: ########## @@ -75,6 +75,26 @@ if $cygwin || $mingw ; then fi fi +# A cygpath(1) from an unrelated POSIX emulation layer (e.g. the one shipped in +# an Anaconda installation) can be found on the PATH first. It re-roots every +# POSIX path under its own installation prefix, so all converted values point to +# non-existing directories and the JVM dies with a bare ClassNotFoundException. +# cygpath can convert relative paths too, but the current directory is the only +# path that is known to exist at this point: verify that its Windows form can be +# found on disk before trusting any of the later conversions. +if $cygwin || $mingw ; then + _cygpath_bin=`( \unset -f command; \command -v cygpath )` || _cygpath_bin= + _probe_win=`cygpath --windows "$PWD"` || _probe_win= + if [ -z "$_probe_win" ] || [ ! -d "$_probe_win" ] ; then + echo "Warning: the cygpath found on the PATH (\"$_cygpath_bin\") does not convert paths to" >&2 + echo "usable Windows paths (\"$PWD\" converts to \"$_probe_win\", which does not exist)," >&2 + echo "so Apache Maven cannot convert paths to the Windows format." >&2 + echo "Some plugins may misbehave when they receive POSIX paths." >&2 Review Comment: Applied in 4883fca — you were right, I reproduced the truncation under dash with a c-prefixed temp-dir component (assertion fails on the pre-fix code, passes with printf). Comment above has the full evidence. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
