You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ch...@apache.org on 2022/01/25 08:36:13 UTC

[incubator-kyuubi] branch master updated: [KYUUBI #1834] [BUILD] Add support of external mvn with default mvn jvm opts when making distribution

This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new fecbd70  [KYUUBI #1834] [BUILD] Add support of external mvn with default mvn jvm opts when making distribution
fecbd70 is described below

commit fecbd701210630a38a9b1d2b710ddd46e571b2a4
Author: jing10.gao <ji...@vipshop.com>
AuthorDate: Tue Jan 25 16:36:03 2022 +0800

    [KYUUBI #1834] [BUILD] Add support of external mvn with default mvn jvm opts when making distribution
    
    ### _Why are the changes needed?_
    
    most of time, we use the mvn pre-installed in the OS
    
    ### _How was this patch tested?_
    
    After running the script `build/dist`, it should echo the 'MVN' location before building the release package
    
    ```bash
    build/dist --tgz --name release-demo \
            --spark-provided --flink-provided \
            --mvn $(which mvn) \
            -DskipTests \
            -Pjava-8 -Pspark-hadoop-3.2 -Pspark-3.0
    ```
    
    Closes #1834 from goldenbean/dev/mvn.
    
    Closes #1834
    
    26f13da8 [jing10.gao] break usage into multi-lines
    e1d14d3c [jing10.gao] update the usage
    954e8471 [jing10.gao] external mvn
    056c518f [jing10.gao] external mvn
    
    Authored-by: jing10.gao <ji...@vipshop.com>
    Signed-off-by: Cheng Pan <ch...@apache.org>
---
 build/dist | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/build/dist b/build/dist
index e3d3748..f4d0d42 100755
--- a/build/dist
+++ b/build/dist
@@ -41,12 +41,14 @@ function usage {
   echo ""
   echo "Usage:"
   echo "+--------------------------------------------------------------------------------------+"
-  echo "| ./build/dist [--name <custom_name>] [--tgz] [--flink-provided] [--spark-provided] <maven build options> |"
+  echo "| ./build/dist [--name <custom_name>] [--tgz] [--flink-provided] [--spark-provided]    |"
+  echo "|              [--mvn <maven_executable>] <maven build options>                        |"
   echo "+--------------------------------------------------------------------------------------+"
   echo "name:           -  custom binary name, using project version if undefined"
   echo "tgz:            -  whether to make a whole bundled package"
   echo "flink-provided: -  whether to make a package without Flink binary"
   echo "spark-provided: -  whether to make a package without Spark binary"
+  echo "mvn:            -  external maven executable location"
   echo ""
 }
 
@@ -68,6 +70,10 @@ while (( "$#" )); do
     --spark-provided)
       SPARK_PROVIDED=true
       ;;
+    --mvn)
+      MVN="$2"
+      shift
+      ;;
     --name)
       NAME="$2"
       shift
@@ -112,6 +118,16 @@ if [[ $(command -v git) ]]; then
     unset GITREV
 fi
 
+
+if [ ! "$(command -v "$MVN")" ] ; then
+    echo -e "Could not locate Maven command: '$MVN'."
+    echo -e "Specify the Maven command with the --mvn flag"
+    exit -1;
+fi
+
+echo "MVN is set to $MVN"
+
+
 VERSION=$("$MVN" help:evaluate -Dexpression=project.version $@ 2>/dev/null\
     | grep -v "INFO"\
     | grep -v "WARNING"\
@@ -170,6 +186,7 @@ else
 fi
 
 MVN_DIST_OPT="-DskipTests"
+
 if [[ "$SPARK_PROVIDED" == "true" ]]; then
   MVN_DIST_OPT="$MVN_DIST_OPT -Pspark-provided"
 fi
@@ -178,6 +195,8 @@ if [[ "$FLINK_PROVIDED" == "true" ]]; then
   MVN_DIST_OPT="$MVN_DIST_OPT -Pflink-provided"
 fi
 
+export MAVEN_OPTS="${MAVEN_OPTS:--Xmx2g}"
+
 BUILD_COMMAND=("$MVN" clean install $MVN_DIST_OPT $@)
 
 echo -e "\nBuilding with..."