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

morningman pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-doris-spark-connector.git

commit ee6969ab68a3f7c7089a2d498e5ff3e904ada8d1
Author: Zhengguo Yang <yangz...@gmail.com>
AuthorDate: Wed Jan 5 10:45:11 2022 +0800

    [refactor] update parent pom  version and optimize build scripts (#7548)
---
 build.sh    |  49 ++++----
 pom.xml     |  39 +++++--
 pom_3.0.xml | 372 ------------------------------------------------------------
 3 files changed, 56 insertions(+), 404 deletions(-)

diff --git a/build.sh b/build.sh
index 9fe907c..d747ba3 100755
--- a/build.sh
+++ b/build.sh
@@ -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/
diff --git a/pom.xml b/pom.xml
index b62f193..a4f2e9c 100644
--- a/pom.xml
+++ b/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>
diff --git a/pom_3.0.xml b/pom_3.0.xml
deleted file mode 100644
index 3de0873..0000000
--- a/pom_3.0.xml
+++ /dev/null
@@ -1,372 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0";
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-         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>
-    </parent>
-    <groupId>org.apache</groupId>
-    <artifactId>doris-spark-connector</artifactId>
-    <version>${spark.version}-${scala.version}-SNAPSHOT</version>
-    <name>Doris Spark Connector</name>
-    <url>https://doris.apache.org/</url>
-    <licenses>
-        <license>
-            <name>Apache 2.0 License</name>
-            <url>https://www.apache.org/licenses/LICENSE-2.0.html</url>
-            <distribution>repo</distribution>
-        </license>
-    </licenses>
-    <scm>
-        
<connection>scm:git:g...@github.com:apache/incubator-doris.git</connection>
-        
<developerConnection>scm:git:g...@github.com:apache/incubator-doris.git</developerConnection>
-        <url>scm:git:g...@github.com:apache/incubator-doris.git</url>
-        <tag>HEAD</tag>
-    </scm>
-    <issueManagement>
-        <system>GitHub</system>
-        <url>https://github.com/apache/incubator-doris/issues</url>
-    </issueManagement>
-
-    <mailingLists>
-        <mailingList>
-            <name>Dev Mailing List</name>
-            <post>d...@doris.apache.org</post>
-            <subscribe>dev-subscr...@doris.apache.org</subscribe>
-            <unsubscribe>dev-unsubscr...@doris.apache.org</unsubscribe>
-        </mailingList>
-
-        <mailingList>
-            <name>Commits Mailing List</name>
-            <post>commits@doris.apache.org</post>
-            <subscribe>commits-subscr...@doris.apache.org</subscribe>
-            <unsubscribe>commits-unsubscr...@doris.apache.org</unsubscribe>
-        </mailingList>
-    </mailingLists>
-
-    <properties>
-        <scala.version>2.12</scala.version>
-        <spark.version>3.1.2</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>
-        <maven-javadoc-plugin.version>3.3.0</maven-javadoc-plugin.version>
-        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <doris.thirdparty>${env.DORIS_THIRDPARTY}</doris.thirdparty>
-    </properties>
-
-    <profiles>
-        <!-- for custom internal repository -->
-        <profile>
-            <id>custom-env</id>
-            <activation>
-                <property>
-                    <name>env.CUSTOM_MAVEN_REPO</name>
-                </property>
-            </activation>
-
-            <repositories>
-                <repository>
-                    <id>custom-nexus</id>
-                    <url>${env.CUSTOM_MAVEN_REPO}</url>
-                </repository>
-            </repositories>
-
-            <pluginRepositories>
-                <pluginRepository>
-                    <id>custom-nexus</id>
-                    <url>${env.CUSTOM_MAVEN_REPO}</url>
-                </pluginRepository>
-            </pluginRepositories>
-        </profile>
-
-        <!-- for general repository -->
-        <profile>
-            <id>general-env</id>
-            <activation>
-                <property>
-                    <name>!env.CUSTOM_MAVEN_REPO</name>
-                </property>
-            </activation>
-
-            <repositories>
-                <repository>
-                    <id>central</id>
-                    <name>central maven repo https</name>
-                    <url>https://repo.maven.apache.org/maven2</url>
-                </repository>
-            </repositories>
-        </profile>
-    </profiles>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.spark</groupId>
-            <artifactId>spark-core_${scala.version}</artifactId>
-            <version>${spark.version}</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.spark</groupId>
-            <artifactId>spark-sql_${scala.version}</artifactId>
-            <version>${spark.version}</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.thrift</groupId>
-            <artifactId>libthrift</artifactId>
-            <version>${libthrift.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.arrow</groupId>
-            <artifactId>arrow-vector</artifactId>
-            <version>${arrow.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.arrow</groupId>
-            <artifactId>arrow-memory-netty</artifactId>
-            <version>${arrow.version}</version>
-            <scope>runtime</scope>
-        </dependency>
-        <!--Test-->
-        <dependency>
-            <groupId>org.hamcrest</groupId>
-            <artifactId>hamcrest-core</artifactId>
-            <version>1.3</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-scala_${scala.version}</artifactId>
-            <version>1.4.7</version>
-            <exclusions>
-                <exclusion>
-                    <artifactId>hamcrest-core</artifactId>
-                    <groupId>org.hamcrest</groupId>
-                </exclusion>
-            </exclusions>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.11</version>
-            <exclusions>
-                <exclusion>
-                    <artifactId>hamcrest-core</artifactId>
-                    <groupId>org.hamcrest</groupId>
-                </exclusion>
-            </exclusions>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-databind</artifactId>
-            <version>2.10.0</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-core</artifactId>
-            <version>2.10.0</version>
-        </dependency>
-        <dependency>
-            <groupId>io.netty</groupId>
-            <artifactId>netty-all</artifactId>
-            <version>4.1.27.Final</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.12</version>
-            <scope>test</scope>
-        </dependency>
-
-    </dependencies>
-
-    <build>
-        <plugins>
-            <!-- add gensrc java build src dir -->
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <version>3.2.0</version>
-                <executions>
-                    <execution>
-                        <id>add-source</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>add-source</goal>
-                        </goals>
-                        <configuration>
-                            <sources>
-                                <!-- add arbitrary num of src dirs here -->
-                                
<source>${project.build.directory}/generated-sources/thrift/</source>
-                            </sources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.thrift.tools</groupId>
-                <artifactId>maven-thrift-plugin</artifactId>
-                <version>0.1.11</version>
-                <configuration>
-                    
<thriftExecutable>${doris.thirdparty}/installed/bin/thrift</thriftExecutable>
-                    <generator>java:fullcamel</generator>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>thrift-sources</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>compile</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>net.alchim31.maven</groupId>
-                <artifactId>scala-maven-plugin</artifactId>
-                <version>3.2.1</version>
-                <executions>
-                    <execution>
-                        <id>scala-compile-first</id>
-                        <phase>process-resources</phase>
-                        <goals>
-                            <goal>compile</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>scala-test-compile</id>
-                        <phase>process-test-resources</phase>
-                        <goals>
-                            <goal>testCompile</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <args>
-                        <arg>-feature</arg>
-                    </args>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-shade-plugin</artifactId>
-                <version>3.2.1</version>
-                <configuration>
-                    <artifactSet>
-                        <excludes>
-                            <exclude>com.google.code.findbugs:*</exclude>
-                            <exclude>org.slf4j:*</exclude>
-                        </excludes>
-                    </artifactSet>
-                    <relocations>
-                        <relocation>
-                            <pattern>org.apache.arrow</pattern>
-                            
<shadedPattern>org.apache.doris.shaded.org.apache.arrow</shadedPattern>
-                        </relocation>
-                        <relocation>
-                            <pattern>io.netty</pattern>
-                            
<shadedPattern>org.apache.doris.shaded.io.netty</shadedPattern>
-                        </relocation>
-                        <relocation>
-                            <pattern>com.fasterxml.jackson</pattern>
-                            
<shadedPattern>org.apache.doris.shaded.com.fasterxml.jackson</shadedPattern>
-                        </relocation>
-                        <relocation>
-                            <pattern>org.apache.commons.codec</pattern>
-                            
<shadedPattern>org.apache.doris.shaded.org.apache.commons.codec</shadedPattern>
-                        </relocation>
-                        <relocation>
-                            <pattern>com.google.flatbuffers</pattern>
-                            
<shadedPattern>org.apache.doris.shaded.com.google.flatbuffers</shadedPattern>
-                        </relocation>
-                        <relocation>
-                            <pattern>org.apache.thrift</pattern>
-                            
<shadedPattern>org.apache.doris.shaded.org.apache.thrift</shadedPattern>
-                        </relocation>
-                    </relocations>
-                </configuration>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>shade</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>${maven-compiler-plugin.version}</version>
-                <configuration>
-                    <source>8</source>
-                    <target>8</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-javadoc-plugin</artifactId>
-                <version>${maven-javadoc-plugin.version}</version>
-                <configuration>
-                    <source>8</source>
-                    <failOnError>false</failOnError>
-                    <aggregate>true</aggregate>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>attach-javadocs</id>
-                        <goals>
-                            <goal>jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-source-plugin</artifactId>
-                <version>${maven-source-plugin.version}</version>
-                <configuration>
-                    <attach>true</attach>
-                </configuration>
-                <executions>
-                    <execution>
-                        <phase>compile</phase>
-                        <goals>
-                            <goal>jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to