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

mvn.bat sets incorrect value to M2_HOME [Windows 2000]

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.0.3
    • Command Line
    • None
    • Windows 2000 SP4 / Maven 2.0

    Description

      When running Maven 2 by calling mvn.bat on Windows 2000 (SP4) the batch file sets M2_HOME to a value including the name of the batch file itself.
      This results in an error:

      ERROR: M2_HOME is set to an invalid directory.
      M2_HOME = C:\maven\maven-2.0\bin\mvn.bat\..
      Please set the M2_HOME variable in your environment to match the location of the Maven installation

      When changing line 72 of mvn.bat to use %~dp0 instead of %~dps0 it works correctly:
      if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0\..

      Looking at the SVN history, this was changed to %~dps0 to work with spaces
      http://svn.apache.org/viewcvs.cgi?rev=163778&view=rev

      Attachments

        Issue Links

          Activity

            People

              kenneyw kenneyw
              ajbanck ajbanck
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: