slachiewicz opened a new issue, #78:
URL: https://github.com/apache/maven-executor/issues/78

   ### Affected version
   
   1.0.0, `main` at ae2fe0e
   
   ### Bug description
   
   `ForkedMavenExecutor` turns `jvmSystemProperties`, `jvmArguments` and a 
non-default `userHomeDirectory` into `-Dkey=value` strings and joins them into 
`MAVEN_OPTS` with spaces 
([`ForkedMavenExecutor.java:120-140`](https://github.com/apache/maven-executor/blob/main/maven-executor/src/main/java/org/apache/maven/executor/forked/ForkedMavenExecutor.java#L120-L140)).
 The `mvn` launcher splits `MAVEN_OPTS` on whitespace, so a value with a space 
becomes extra JVM arguments.
   
   Reproduction: `-B validate` with `jvmSystemProperty("repro.p", "a b")`:
   
   | Maven | value `a` | value `a b` |
   |---|---|---|
   | 3.9.16 | exit 0 | exit 1, stderr `Error: Could not find or load main class 
b` |
   | 4.0.0-rc-7 | exit 0 | exit 1, stderr `Error: Could not find or load main 
class b` |
   
   The embedded executor accepts the same request (exit 0 on both versions). A 
`user.home` under a directory with a space (`C:\Users\First Last`) hits the 
same path.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to