slachiewicz opened a new issue, #76: URL: https://github.com/apache/maven-executor/issues/76
### Affected version 1.0.0, `main` at ae2fe0e ### Bug description With `useMavenArgsEnv` set, `EmbeddedMavenExecutor` inserts each `MAVEN_ARGS` token at index 0 ([`EmbeddedMavenExecutor.java:250`](https://github.com/apache/maven-executor/blob/main/maven-executor/src/main/java/org/apache/maven/executor/embedded/EmbeddedMavenExecutor.java#L250)), so the tokens reach Maven in reverse order. `MAVEN_ARGS="-f sub/pom.xml"` becomes `sub/pom.xml -f`. `ForkedMavenExecutor` appends them in order ([`ForkedMavenExecutor.java:111`](https://github.com/apache/maven-executor/blob/main/maven-executor/src/main/java/org/apache/maven/executor/forked/ForkedMavenExecutor.java#L111)). Reproduction: a project with `sub/pom.xml`, `MAVEN_ARGS="-f sub/pom.xml"` in the environment, and `-B validate` run through `new ForkedMavenExecutor(home, true)` and `new EmbeddedMavenExecutor(home, true)`: | Maven | forked | embedded | |---|---|---| | 3.9.16 | exit 0 | exit 1 | | 4.0.0-rc-7 | exit 0 | exit 1 | Any multi-token value is affected (`-P foo`, `-s settings.xml`, `-T 2`). -- 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]
