Skip to content

Commit a28fe84

Browse files
committed
[OPENJDK-1548] clear MAVEN_ARGS in Maven's environment
Future versions of Maven will honour the environment variable MAVEN_ARGS (using it in much the same way we do). It's possible that this would result in two copies of arguments being supplied to Maven. To prevent that, unset MAVEN_ARGS in the environment in which Maven runs, after expanding it as command-line options. Signed-off-by: Jonathan Dowland <[email protected]>
1 parent 909fe5f commit a28fe84

File tree

1 file changed

+5
-2
lines changed
  • modules/maven/default/artifacts/opt/jboss/container/maven/default

1 file changed

+5
-2
lines changed

modules/maven/default/artifacts/opt/jboss/container/maven/default/maven.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,11 @@ function maven_build() {
8181
log_info "Using MAVEN_OPTS ${MAVEN_OPTS}"
8282
log_info "Using $(mvn $MAVEN_ARGS --version)"
8383
log_info "Running 'mvn $MAVEN_ARGS $goals'"
84-
# Execute the actual build
85-
mvn $MAVEN_ARGS $goals
84+
85+
# Execute the actual build (ensuring MAVEN_ARGS is unset, OPENJDK-1548)
86+
REAL_MAVEN_ARGS="$MAVEN_ARGS"
87+
unset MAVEN_ARGS
88+
mvn $REAL_MAVEN_ARGS $goals
8689

8790
popd &> /dev/null
8891

0 commit comments

Comments
 (0)