apache / apache/maven-wrapper

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

Open
#317 2 comments 1 reaction 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
254
Forks
78
Avg merge
5h 26m
Merged PRs (30d)
2

Description

**[Jack Green](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=JIRAUSER307283)** opened **[MWRAPPER-151](https://issues.apache.org/jira/browse/MWRAPPER-151?redirect=false)** and commented

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

 

```java
'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](https://issues.apache.org/jira/browse/MWRAPPER-147) mvnw fails on Windows if user name contains whitespace

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.