Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Won't Do
-
3.8.6, 3.8.7, 3.9.0
-
None
-
None
-
Patch
Description
Summary:
As I saw in 3.8.6, on Windows, in mvn.cmd, line 200, it starts with:
cmd /C...
It can reach the system "cmd.exe" correctly most of the time.
However, in one of my project root directory, I accidently made a "cmd.bat", which is used by eclipse to enter the project directory quickly. Then the above quoted code will hit my code instead of the expected one.
Steps to reproduce problem:
in the root directory of a maven project, create cmd.bat, with 1-line content
cmd /k cd %~dp0
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 directory, 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:
cmd.exe /C...
by adding ".exe"
Attachments
Issue Links
- is superceded by
-
MNG-7197 Simplify exit code handling in Windows command startup script
- Closed