Skip to content

Commit 4a2ae60

Browse files
committed
[OPENJDK-1549] 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 625641f commit 4a2ae60

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
@@ -74,8 +74,11 @@ function maven_build() {
7474
log_info "Using MAVEN_OPTS ${MAVEN_OPTS}"
7575
log_info "Using $(mvn $MAVEN_ARGS --version)"
7676
log_info "Running 'mvn $MAVEN_ARGS $goals'"
77-
# Execute the actual build
78-
mvn $MAVEN_ARGS $goals
77+
78+
# Execute the actual build (ensuring MAVEN_ARGS is unset, OPENJDK-1549)
79+
REAL_MAVEN_ARGS="$MAVEN_ARGS"
80+
unset MAVEN_ARGS
81+
mvn $REAL_MAVEN_ARGS $goals
7982

8083
popd &> /dev/null
8184

0 commit comments

Comments
 (0)