Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7674

Windows mvn.cmd should call cmd.exe explicitly

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Won't Do
    • 3.8.6, 3.8.7, 3.9.0
    • None
    • Command Line
    • 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

          Activity

            People

              michael-o Michael Osipov
              daifei4321 Fei Dai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 10m
                  10m
                  Remaining:
                  Remaining Estimate - 10m
                  10m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified