Skip to content

Commit c4e98ff

Browse files
Brennon YorkJoshRosen
Brennon York
authored andcommitted
[SPARK-8933] [BUILD] Provide a --force flag to build/mvn that always uses downloaded maven
added --force flag to manually download, if necessary, and use a built-in version of maven best for spark Author: Brennon York <[email protected]> Closes apache#7374 from brennonyork/SPARK-8933 and squashes the following commits: d673127 [Brennon York] added --force flag to manually download, if necessary, and use a built-in version of maven best for spark
1 parent 37f2d96 commit c4e98ff

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

build/mvn

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,17 @@ install_scala() {
112112
# the environment
113113
ZINC_PORT=${ZINC_PORT:-"3030"}
114114

115+
# Check for the `--force` flag dictating that `mvn` should be downloaded
116+
# regardless of whether the system already has a `mvn` install
117+
if [ "$1" == "--force" ]; then
118+
FORCE_MVN=1
119+
shift
120+
fi
121+
115122
# Install Maven if necessary
116123
MVN_BIN="$(command -v mvn)"
117124

118-
if [ ! "$MVN_BIN" ]; then
125+
if [ ! "$MVN_BIN" -o -n "$FORCE_MVN" ]; then
119126
install_mvn
120127
fi
121128

@@ -139,5 +146,7 @@ fi
139146
# Set any `mvn` options if not already present
140147
export MAVEN_OPTS=${MAVEN_OPTS:-"$_COMPILE_JVM_OPTS"}
141148

149+
echo "Using \`mvn\` from path: $MVN_BIN"
150+
142151
# Last, call the `mvn` command as usual
143152
${MVN_BIN} "$@"

0 commit comments

Comments
 (0)