You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "hohwille (via GitHub)" <gi...@apache.org> on 2025/11/24 12:48:48 UTC

[I] [regression] Maven4 unable [maven]

hohwille opened a new issue, #11487:
URL: https://github.com/apache/maven/issues/11487

   ### Affected version
   
   4.0.0-rc-5
   
   ### Bug description
   
   Updating to Maven4 breaks my usage scenario:
   ```
   $ echo $MAVEN_ARGS
   -s D:\projects\mmm\conf\mvn\settings.xml -Dsettings.security=D:\projects\mmm\conf\mvn\settings-security.xml
   $ mvn -v
   [ERROR] Error executing Maven.
   [ERROR] The specified user settings file does not exist: D:\projects\mmm\projectsmmmconfmvnsettings.xml
   ```
   
   To me it looks as if maven4 does some transformation with backslashes in path's.
   Maybe also the wrapper script calling maven via Java is causing this effect.
   If diffed the `mvn` wrapper script and found that in 3.9.9 it was containing this relevant block that was removed in maven 4.0:
   ```
   # For MinGW, ensure paths are in Unix format before anything is touched
   if $mingw ; then
     [ -n "$MAVEN_HOME" ] &&
       MAVEN_HOME=`(cd "$MAVEN_HOME"; pwd)`
     [ -n "$JAVA_HOME" ] &&
       JAVA_HOME=`(cd "$JAVA_HOME"; pwd)`
     # TODO classpath?
   fi
   ```
   
   When I downgrade to maven 3.x it works again:
   ```
   $ mvn -v
   WARNING: A restricted method in java.lang.System has been called
   WARNING: java.lang.System::load has been called by org.fusesource.jansi.internal.JansiLoader in an unnamed module (file:/D:/projects/mmm/software/mvn/lib/jansi-2.4.1.jar)
   WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
   WARNING: Restricted methods will be blocked in a future release unless native access is enabled
   
   Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
   Maven home: D:\projects\mmm\software\mvn
   Java version: 25, vendor: Eclipse Adoptium, runtime: D:\projects\mmm\software\java
   Default locale: en_US, platform encoding: UTF-8
   OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
   ```


-- 
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: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [regression] Maven4 unable to pass settings path on Windows [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet closed issue #11487: [regression] Maven4 unable to pass settings path on Windows
URL: https://github.com/apache/maven/issues/11487


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [regression] Maven4 unable to pass settings path on Windows [maven]

Posted by "hohwille (via GitHub)" <gi...@apache.org>.
hohwille commented on issue #11487:
URL: https://github.com/apache/maven/issues/11487#issuecomment-4380575099

   @gnodet thanks for creating a PR. Looks promising.
   
   BTW: I can confirm that the error goes away if I replace all backslashes in the paths with regular slashes.
   Just wanted to document this as a simple workaround.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [regression] Maven4 unable to pass settings path on Windows [maven]

Posted by "hohwille (via GitHub)" <gi...@apache.org>.
hohwille commented on issue #11487:
URL: https://github.com/apache/maven/issues/11487#issuecomment-3570657536

   Please note that when setting e.g. `MAVEN_ARGS` on Windows, I expect this to work in different environments:
   * MS DOS (aka CMD)
   * Git-Bash
   * Maybe even in cygwin (see #10810 that seems related)
   
   I therefore have to specify the PATH syntax in Windows style with drive letter followed by colon (and using backslashes).


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [regression] Maven4 unable to pass settings path on Windows [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on issue #11487:
URL: https://github.com/apache/maven/issues/11487#issuecomment-3581725333

   Note that `mvnd` does translate (only the current directory) when running in Cygwin, see https://github.com/apache/maven-mvnd/blob/7b309de9ab8e8ed4e65cb43f59c9a3e22edc69e0/daemon/src/main/java/org/mvndaemon/mvnd/cli/EnvHelper.java#L97-L109


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [regression] Maven4 unable to pass settings path on Windows [maven]

Posted by "hohwille (via GitHub)" <gi...@apache.org>.
hohwille commented on issue #11487:
URL: https://github.com/apache/maven/issues/11487#issuecomment-3570693710

   If I test the same in `CMD` terminal on Windows it is working:
   ```
   D:\projects\mmm>echo %MAVEN_ARGS%
   -s D:\projects\mmm\conf\mvn\settings.xml -Dsettings.security=D:\\projects\\mmm\\conf\\mvn\\settings-security.xml
   D:\projects\mmm>mvn -v
   Apache Maven 4.0.0-rc-5 (fb3ecaef88106acb40467a450248dfdbd75f3b35)
   Maven home: D:\projects\mmm\software\mvn
   Java version: 25, vendor: Eclipse Adoptium, runtime: D:\projects\mmm\software\java
   Default locale: en_US, platform encoding: UTF-8
   OS name: "windows 11", version: "10.0", arch: "amd64", family: "winnt"
   ```


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [regression] Maven4 unable to pass settings path on Windows [maven]

Posted by "hohwille (via GitHub)" <gi...@apache.org>.
hohwille commented on issue #11487:
URL: https://github.com/apache/maven/issues/11487#issuecomment-3597835042

   This bug seems to be slightly related to #10834


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [regression] Maven4 unable to pass settings path on Windows [maven]

Posted by "hohwille (via GitHub)" <gi...@apache.org>.
hohwille commented on issue #11487:
URL: https://github.com/apache/maven/issues/11487#issuecomment-3597933543

   Some first traces browsing the source-code:
   * https://github.com/apache/maven/blob/f93b5629a09efd80c04d9e99ca1f4f5d3f70cdf7/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/BaseParser.java#L219-L221
   * https://github.com/apache/maven/blob/f93b5629a09efd80c04d9e99ca1f4f5d3f70cdf7/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/BaseParser.java#L247-L253
   * https://github.com/apache/maven/blob/f93b5629a09efd80c04d9e99ca1f4f5d3f70cdf7/api/maven-api-cli/src/main/java/org/apache/maven/api/cli/Options.java#L127
   * https://github.com/apache/maven/blob/f93b5629a09efd80c04d9e99ca1f4f5d3f70cdf7/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/CommonsCliOptions.java#L142-L147
   


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [regression] Maven4 unable to pass settings path on Windows [maven]

Posted by "hohwille (via GitHub)" <gi...@apache.org>.
hohwille commented on issue #11487:
URL: https://github.com/apache/maven/issues/11487#issuecomment-3597812693

   @khmarbaise I would even create a PR to fix such issue myself.
   Do you happen to have some instructions how to setup and debug Maven directly from its source-code?
   I always failed at this point to deep dive into maven core.
   Implementing and debugging Mojos is what I have done already a lot...
   So if you have a guess how to start, I am happy to support by creating a PR.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [regression] Maven4 unable to pass settings path on Windows [maven]

Posted by "hohwille (via GitHub)" <gi...@apache.org>.
hohwille commented on issue #11487:
URL: https://github.com/apache/maven/issues/11487#issuecomment-3597783415

   > Note that `mvnd` does translate (only the current directory) when running in Cygwin, see https://github.com/apache/maven-mvnd/blob/7b309de9ab8e8ed4e65cb43f59c9a3e22edc69e0/daemon/src/main/java/org/mvndaemon/mvnd/cli/EnvHelper.java#L97-L109
   
   Nice feature. However, I stopped using `cygwin` and only use git-bash that it based on MINGW.
   * Windows C:\Users
   * git-bas: /c/users
   * cygwin: /cygdrive/c/users
   
   BTW: Besides this product flawer sneaking in with `/cygdrive` I especially dislike that `cygwin` creates its own users home directory so you have two different home directories as a Windows user what IMHO causes a lot of trouble and confusion.
   However `cygwin` is still great if you want to install packages and special GNU Linux software without virtualisation (WSL2 or even a full VM).


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org