apache / apache/maven-wrapper

[MWRAPPER-90] Use arrays to preserve potential whitespace in arguments

Open
#229 1 comment 0 reactions 0 assignees View on GitHub
enhancement priority:major
Dominant language
Java
Stars
254
Forks
78
Avg merge
5h 26m
Merged PRs (30d)
2

Description

**[Benjamin Marwell](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=mampf86)** opened **[MWRAPPER-90](https://issues.apache.org/jira/browse/MWRAPPER-90?redirect=false)** and commented

The bash scripts call mvn using:

```java
1. shellcheck disable=SC2086 # safe args
exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
```

However, this might mangle parameters containing spaces into multiple parameters. It would be only safe when using arrays and use quotes, e.g. `{}"${MAVEN_OPTS[@]}"{`}. Same for the others. This would also allow us to disable the shellcheck check.

---
No further details from [MWRAPPER-90](https://issues.apache.org/jira/browse/MWRAPPER-90?redirect=false)

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.