Krystian Panek created MWRAPPER-122:
---------------------------------------

             Summary: Mingw paths problem on Windows
                 Key: MWRAPPER-122
                 URL: https://issues.apache.org/jira/browse/MWRAPPER-122
             Project: Maven Wrapper
          Issue Type: Bug
            Reporter: Krystian Panek


When I call the Maven wrapper from [Taskfile.dev|https://taskfile.dev/] then 
only on Windows in GitBash (on Mac and Linux works without problems) the 
following command is executed (I just replaced the last "exec" statement with 
"echo" to troubleshoot):
{code:java}
/c/Program Files/Eclipse Adoptium/jdk-11.0.14.101-hotspot/bin/java -classpath 
C:\Projects\acme-aem-acme-mono-ad86003b367a/.mvn/wrapper/maven-wrapper.jar 
-Dmaven.multiModuleProjectDirectory=C:\Projects\acme-aem-acme-mono-ad86003b367a 
org.apache.maven.wrapper.MavenWrapperMain clean install -N{code}
Note that {*}bad path separators are generated{*}.

To fix the problem I needed to update the code:
{code:java}
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then{code}
to the following:
{code:java}
# For Cygwin or Mingw, switch paths to Windows format before running java
if [ "$cygwin" ] || [ "$mingw" ]; then{code}
then I have a working exec command generated:
{code:java}
/c/Program Files/Eclipse Adoptium/jdk-11.0.14.101-hotspot/bin/java -classpath 
/c/Projects/acme-aem-acme-mono-ad86003b367a/.mvn/wrapper/maven-wrapper.jar 
-Dmaven.multiModuleProjectDirectory=/c/Projects/acme-aem-acme-mono-ad86003b367a 
org.apache.maven.wrapper.MavenWrapperMain clean install -N{code}
It would be nice to make the "mvnw script work in more use cases. by 
introducing the fix like the above or similar making my integration work 
without problems. 

 

Greetings, Krystian



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to