[MWRAPPER-151] Maven Wrapper not handling usernames with spaces on Windows

Open
#317 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
powershell
Domain
build-system

Research direction

Start by generating the Maven wrapper on Windows with a username containing spaces, then inspect the wrapper command around the mentioned Write-Output pattern. Run the newly created Maven wrapper with mvnw --version; done means it starts Maven successfully and no longer treats the spaced user path as a command.

Written by the indexing model from the issue text.

Description

bug priority:major

Jack Green opened MWRAPPER-151 and commented

When Maven wrapper is run on a username with spaces on Windows, it doesn’t work and an error is produced:

 

'C:\Users\Test' is not recognized as an internal or external command, operable program or batch file.
Cannot start maven from wrapper 

 

 

Reproducer:

  • Have a username with spaces is in it (e.g. {}Test User Name{})

  • Create Maven wrapper ({}mvn wrapper:wrapper{})

  • Run the newly created Maven wrapper ({}mvnw –version{})

 

I suspect this is being caused by the following pattern:

Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"

 

Where $MAVEN_HOME contains spaces and is not being quoted correctly.


Affects: 3.3.2

Issue Links:

  • MWRAPPER-147 mvnw fails on Windows if user name contains whitespace
Dominant language
Java
Stars
254
Forks
78
Avg merge
9h 4m
Merged PRs (30d)
5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/maven-wrapper

All issues in apache/maven-wrapper

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.