Maven 2 & 3

mvn.bat doesn't handle ampersand in Windows user name properly

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0.9
  • Fix Version/s: 2.0.11, 2.1.0, 3.0-alpha-1
  • Component/s: Command Line
  • Labels:
    None
  • Environment:
    Windows Vista Small Business
  • Complexity:
    Intermediate
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

Description

Halo!

Maven don't work when In Windows user has ampersand in the name for example username=Tom&Jerry. Windows allows usernames like this, but Maven treat ampersand in the name of users main folder as a part of some url or something ... and cannot get path properly. Windows do not allow to change username with all user's foldernames.

Artur

Issue Links

Activity

Hide
Benjamin Bentmann added a comment -

Extraced from MNG-3662 to separate the CLI issue from the interpolation issue. Reposting my relevant comment:

The only problem I observed with the ampersand character was in the batch files launching Maven, more precisely in

@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set HOME=%HOMEDRIVE%%HOMEPATH%)

which causes something like "Jerry is not recognized as an internal or external command" when executing the set command for the user name "Tom&Jerry".

As outlined in the Windows Command Shell Overview and KB-103368, the ampersand is a special character that needs escaping, e.g. by surrounding with quots.

If you encounter other errors besides the one mentioned, please provide a full debug log of Maven.

Show
Benjamin Bentmann added a comment - Extraced from MNG-3662 to separate the CLI issue from the interpolation issue. Reposting my relevant comment: The only problem I observed with the ampersand character was in the batch files launching Maven, more precisely in
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set HOME=%HOMEDRIVE%%HOMEPATH%)
which causes something like "Jerry is not recognized as an internal or external command" when executing the set command for the user name "Tom&Jerry". As outlined in the Windows Command Shell Overview and KB-103368, the ampersand is a special character that needs escaping, e.g. by surrounding with quots. If you encounter other errors besides the one mentioned, please provide a full debug log of Maven.
Hide
Benjamin Bentmann added a comment -

Installing Maven into a directory like "C:\Tom&Jerry" doesn't work at all as further stuff like M2_HOME lacks proper quoting.

Show
Benjamin Bentmann added a comment - Installing Maven into a directory like "C:\Tom&Jerry" doesn't work at all as further stuff like M2_HOME lacks proper quoting.
Hide
Benjamin Bentmann added a comment -

Fixed in r728264, r728265 and r728267, respectively.

Show
Benjamin Bentmann added a comment - Fixed in r728264, r728265 and r728267, respectively.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: