apache / apache/maven-invoker

[MSHARED-832] Cannot invoke maven from path with parentheses on Windows

Open
#127 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
22
Forks
25
PR merge metrics
No merged PRs in 30d

Description

**[Anton Krylov](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=aek)** opened **[MSHARED-832](https://issues.apache.org/jira/browse/MSHARED-832?redirect=false)** and commented

When `M2_HOME` is set to a path with parentheses (in this case `C:\work\lol(1)\maven)`, the following command is generated on windows:

```
cmd.exe /X /C "C:\work\lol(1)\maven\bin\mvn.cmd -B -e -V compile"
```

This command fails, saying that C:\work\lol is not a known command

When a space is added to the path, the path gets escaped, and the command runs successfully.

It looks like more characters need to be escaped on some platforms

---

**Affects:** maven-invoker-2.2

**Issue Links:**
- [MSHARED-765](https://issues.apache.org/jira/browse/MSHARED-765) Password not escaped (on windows?)

1 votes, 3 watchers

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the Windows failure with M2_HOME set to a path containing parentheses, then compare it with the working case where the path also contains a space. Trace the command generation around the shown cmd.exe invocation and verify that the corrected command runs successfully from such a path.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.