gnodet-bot commented on code in PR #13593: URL: https://github.com/apache/maven/pull/13593#discussion_r4302174133
########## apache-maven/src/bin/mvn: ########## @@ -309,6 +309,43 @@ if [ -n "$MAVEN_ARGS" ]; then done fi +# MNG-8056: Under Cygwin, the JVM is a native Windows process and cannot resolve +# Cygwin-style POSIX paths (e.g. /cygdrive/c/...) directly. The internal paths +# (MAVEN_HOME, CLASSWORLDS_CONF, JAVA_HOME, ...) are already converted above, but +# user-supplied paths passed via -f/--file, -s/--settings, -gs/--global-settings, +# -t/--toolchains, -gt/--global-toolchains, -ps/--project-settings, +# -is/--install-settings, -it/--install-toolchains and -l/--log-file reach the JVM +# unconverted. +# The loop below rewrites only those argument values that begin with '/' (absolute +# POSIX paths); relative paths and already-Windows paths are left unchanged. +# MinGW/MSYS2 perform automatic path mangling, so the fix is Cygwin-only. +if $cygwin ; then + _np=false + _count=$# + while [ $_count -gt 0 ]; do + _a="$1" + shift + if $_np; then + case "$_a" in + /*) _a=`cygpath --windows "$_a"` ;; + esac + _np=false + else + case "$_a" in + -f|--file|-s|--settings|-gs|--global-settings|-t|--toolchains|-gt|--global-toolchains|-ps|--project-settings|-is|--install-settings|-it|--install-toolchains|-l|--log-file) Review Comment: 💡 **Cosmetic / dead code:** `-ps`/`--project-settings`, `-is`/`--install-settings`, and `-it`/`--install-toolchains` don't exist in `CLIManager.java` on `maven-3.10.x`, so they'll never match. Carrying them over from master is harmless — the case arm just never fires — but it's technically dead code. Feel free to drop them for cleanliness, though leaving them in is also fine. -- 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]
