Skip to content

Commit

Permalink
[SPARK-8933] [BUILD] Provide a --force flag to build/mvn that always …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Brennon York authored and JoshRosen committed Jul 14, 2015
1 parent 37f2d96 commit c4e98ff
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion build/mvn
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,17 @@ install_scala() {
# the environment
ZINC_PORT=${ZINC_PORT:-"3030"}

# Check for the `--force` flag dictating that `mvn` should be downloaded
# regardless of whether the system already has a `mvn` install
if [ "$1" == "--force" ]; then
FORCE_MVN=1
shift
fi

# Install Maven if necessary
MVN_BIN="$(command -v mvn)"

if [ ! "$MVN_BIN" ]; then
if [ ! "$MVN_BIN" -o -n "$FORCE_MVN" ]; then
install_mvn
fi

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

echo "Using \`mvn\` from path: $MVN_BIN"

# Last, call the `mvn` command as usual
${MVN_BIN} "$@"

0 comments on commit c4e98ff

Please sign in to comment.