Skip to content
Permalink
Browse files
[refactor] update parent pom version and optimize build scripts (#7548)
  • Loading branch information
yangzhg committed Jan 5, 2022
1 parent 37383c7 commit ee6969ab68a3f7c7089a2d498e5ff3e904ada8d1
Showing 3 changed files with 56 additions and 404 deletions.
@@ -25,23 +25,38 @@

set -eo pipefail

ROOT=`dirname "$0"`
ROOT=`cd "$ROOT"; pwd`
usage() {
echo "
Usage:
$0 spark_version scala_version
e.g.:
$0 2.3.4 2.11
$0 3.1.2 2.12
"
exit 1
}

if [ $# -ne 2 ]; then
usage
fi

ROOT=$(dirname "$0")
ROOT=$(cd "$ROOT"; pwd)

export DORIS_HOME=${ROOT}/../../
export PATH=${DORIS_THIRDPARTY}/installed/bin:$PATH

. ${DORIS_HOME}/env.sh
. "${DORIS_HOME}"/env.sh

# include custom environment variables
if [[ -f ${DORIS_HOME}/custom_env.sh ]]; then
. ${DORIS_HOME}/custom_env.sh
. "${DORIS_HOME}"/custom_env.sh
fi

# check maven
MVN_CMD=mvn

if [[ ! -z ${CUSTOM_MVN} ]]; then
if [[ -n ${CUSTOM_MVN} ]]; then
MVN_CMD=${CUSTOM_MVN}
fi
if ! ${MVN_CMD} --version; then
@@ -50,29 +65,15 @@ if ! ${MVN_CMD} --version; then
fi
export MVN_CMD

usage() {
echo "
Eg.
$0 2 build with spark 2.x
$0 3 build with spark 3.x
"
exit 1
}

if [ $# == 0 ]; then
usage
fi

rm -rf output/

if [ "$1"x == "3x" ]
then
${MVN_CMD} clean package -f pom_3.0.xml
if [ -z "$1" ]; then
export SPARK_VERSION="$1"
fi
if [ "$1"x == "2x" ]
then
${MVN_CMD} clean package
if [ -z "$2" ]; then
export SCALA_VERSION="$2"
fi
${MVN_CMD} clean package

mkdir -p output/
cp target/doris-spark-*.jar ./output/
39 pom.xml
@@ -19,18 +19,18 @@
under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>18</version>
<version>23</version>
</parent>
<groupId>org.apache.doris</groupId>
<artifactId>doris-spark-connector</artifactId>
<version>${spark.version}-${scala.version}-SNAPSHOT</version>
<version>${spark.version}-${scala.version}-1.0.0-SNAPSHOT</version>
<name>Doris Spark Connector</name>
<url>https://doris.apache.org/</url>
<licenses>
@@ -68,8 +68,8 @@
</mailingLists>

<properties>
<scala.version>2.11</scala.version>
<spark.version>2.3.4</spark.version>
<scala.version>${env.SCALA_VERSION}</scala.version>
<spark.version>${env.SPARK_VERSION}</spark.version>
<libthrift.version>0.13.0</libthrift.version>
<arrow.version>5.0.0</arrow.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
@@ -103,7 +103,30 @@
</pluginRepository>
</pluginRepositories>
</profile>

<profile>
<id>spark-version</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>!env.SPARK_VERSION</name>
</property>
</activation>
<properties>
<env.SPARK_VERSION>2.3.4</env.SPARK_VERSION>
</properties>
</profile>
<profile>
<id>scala-version</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>!env.SCALA_VERSION</name>
</property>
</activation>
<properties>
<env.SCALA_VERSION>2.11</env.SCALA_VERSION>
</properties>
</profile>
<!-- for general repository -->
<profile>
<id>general-env</id>
@@ -338,9 +361,9 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<skip>true</skip>
<source>8</source>
<failOnError>false</failOnError>
<aggregate>true</aggregate>
</configuration>
<executions>
<execution>

0 comments on commit ee6969a

Please sign in to comment.