Fei Dai created MNG-7674:
----------------------------

             Summary: Windows mvn.cmd should call cmd.exe explicitly.
                 Key: MNG-7674
                 URL: https://issues.apache.org/jira/browse/MNG-7674
             Project: Maven
          Issue Type: Improvement
          Components: Command Line
    Affects Versions: 3.8.7, 3.8.6
            Reporter: Fei Dai


Summary:

As I saw in 3.8.6, on Windows, in mvn.cmd, line 200, it starts with:
{code:java}
cmd /C... {code}
 

It can reach the system "cmd.exe" correctly most of the time.

However, in one of my project root folder, I accidently made a "cmd.bat", which 
is used by eclipse to enter the project folder quickly. Then the above quoted 
code will hit my code instead of the expected one.
----
Steps to reproduce problem:

in the root folder of a maven project, create cmd.bat, with 1-line content
{code:java}
cmd /k cd %~dp0 {code}
If running it from eclipse, because eclipse run it from "C:\windows\system32", 
it will correctly open the command-line.

If running "mvn" in the root folder, with current line 200, the mvn.cmd will go 
into this cmd.bat, and it will then enter itself, and cause infinite loop.

This problem might not be that easy to locate, because after writing that 
cmd.bat, it works as expected in Eclipse. At the same time, when mvn.bat goes 
into infinite loop, there's no special prompt, and all works of mvn.bat are 
done already.
----
Recommended fix:

In that line 200, change it to start with:
{code:java}
cmd.exe /C...{code}
by adding ".exe"

 



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

Reply via email to