[KYUUBI #398][FOLLOWUP] exclude unused jars

![pan3793](https://badgen.net/badge/Hello/pan3793/green) [![Closes #401](https://badgen.net/badge/Preview/Closes%20%23401/blue)](https://github.com/yaooqinn/kyuubi/pull/401) ![47](https://badgen.net/badge/%2B/47/red) ![155](https://badgen.net/badge/-/155/green) ![3](https://badgen.net/badge/commits/3/yellow) [&#10088;?&#10089;](https://pullrequestbadge.com/?utm_medium=github&utm_source=yaooqinn&utm_campaign=badge_info)<!-- PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->

<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/yaooqinn/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [x] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/tools/testing.html#running-tests) locally before make a pull request

Current kyuubi server dist jars
```
➜  kyuubi git:(KYUUBI-398-followup) ll dist/jars
total 122064
-rw-r--r--  1 chengpan  staff   346K Mar  5 01:00 commons-codec-1.15.jar
-rw-r--r--  1 chengpan  staff   511K Mar  5 01:00 commons-lang3-3.10.jar
-rw-r--r--  1 chengpan  staff   2.3M Mar  5 01:00 curator-client-2.12.0.jar
-rw-r--r--  1 chengpan  staff   197K Mar  5 01:00 curator-framework-2.12.0.jar
-rw-r--r--  1 chengpan  staff   277K Mar  5 01:00 curator-recipes-2.12.0.jar
-rw-r--r--  1 chengpan  staff   2.3M Mar  5 01:00 curator-test-2.12.0.jar
-rw-r--r--  1 chengpan  staff   4.5K Mar  5 01:00 failureaccess-1.0.1.jar
-rw-r--r--  1 chengpan  staff   2.7M Mar  5 01:00 guava-30.1-jre.jar
-rw-r--r--  1 chengpan  staff    17M Mar  5 01:00 hadoop-client-api-3.2.2.jar
-rw-r--r--  1 chengpan  staff    22M Mar  5 01:00 hadoop-client-runtime-3.2.2.jar
-rw-r--r--  1 chengpan  staff   1.5M Mar  5 01:00 hive-service-rpc-2.3.7.jar
-rw-r--r--  1 chengpan  staff   1.4M Mar  5 01:00 htrace-core4-4.1.0-incubating.jar
-rw-r--r--  1 chengpan  staff   697K Mar  5 01:00 javassist-3.18.1-GA.jar
-rw-r--r--  1 chengpan  staff    16K Mar  5 01:00 jcl-over-slf4j-1.7.30.jar
-rw-r--r--  1 chengpan  staff   325K Mar  5 01:00 kyuubi-common-1.1.0-SNAPSHOT.jar
-rw-r--r--  1 chengpan  staff    34K Mar  5 01:00 kyuubi-ha-1.1.0-SNAPSHOT.jar
-rw-r--r--  1 chengpan  staff    81K Mar  5 01:00 kyuubi-main-1.1.0-SNAPSHOT.jar
-rw-r--r--  1 chengpan  staff   306K Mar  5 01:00 libfb303-0.9.3.jar
-rw-r--r--  1 chengpan  staff   229K Mar  5 01:00 libthrift-0.9.3.jar
-rw-r--r--  1 chengpan  staff   478K Mar  5 01:00 log4j-1.2.17.jar
-rw-r--r--  1 chengpan  staff   5.0M Mar  5 01:00 scala-library-2.12.10.jar
-rw-r--r--  1 chengpan  staff    41K Mar  5 01:00 slf4j-api-1.7.30.jar
-rw-r--r--  1 chengpan  staff    12K Mar  5 01:00 slf4j-log4j12-1.7.30.jar
-rw-r--r--  1 chengpan  staff   890K Mar  5 01:00 zookeeper-3.4.14.jar
```

Closes #401 from pan3793/KYUUBI-398-followup.

c96586b [Cheng Pan] reorder deps
207f0b1 [Cheng Pan] restore docs
0f5f2e7 [Cheng Pan] [KYUUBI #398][FOLLOWUP] exclude unused jars

Authored-by: Cheng Pan <379377944@qq.com>
Signed-off-by: Kent Yao <yao@apache.org>
This commit is contained in:
Cheng Pan 2021-03-05 08:57:23 +08:00 committed by Kent Yao
parent 4abc3ff6a0
commit 562c45865f
No known key found for this signature in database
GPG Key ID: F7051850A0AF904D
5 changed files with 47 additions and 155 deletions

View File

@ -187,15 +187,17 @@ echo "Hadoop $HADOOP_VERSION" >> "$DISTDIR/RELEASE"
echo "Hive $HIVE_VERSION" >> "$DISTDIR/RELEASE"
echo "Build flags: $@" >> "$DISTDIR/RELEASE"
# Copy jars
# Copy kyuubi server jars
cp -r "$KYUUBI_HOME/kyuubi-assembly/target/scala-$SCALA_VERSION/jars/" "$DISTDIR/jars"
## cp engines
# Copy spark engines
cp "$KYUUBI_HOME/externals/kyuubi-spark-sql-engine/target/kyuubi-spark-sql-engine-$VERSION.jar" "$DISTDIR/externals/engines/spark"
if [[ "$SPARK_PROVIDED" != "true" ]]; then
# Copy spark binary dist
cp -r "$KYUUBI_HOME/externals/kyuubi-download/target/spark-$SPARK_VERSION-bin-hadoop${SPARK_HADOOP_VERSION}$HIVE_VERSION_SUFFIX/" \
"$DISTDIR/externals/spark-$SPARK_VERSION-bin-hadoop${SPARK_HADOOP_VERSION}$HIVE_VERSION_SUFFIX/"
fi
cp "$KYUUBI_HOME/externals/kyuubi-spark-sql-engine/target/kyuubi-spark-sql-engine-$VERSION.jar" "$DISTDIR/externals/engines/spark"
# Copy license and ASF files
cp "$KYUUBI_HOME/LICENSE" "$DISTDIR"

View File

@ -76,14 +76,12 @@
<artifactId>curator-recipes</artifactId>
</dependency>
<!-- begin: for EmbeddedZkServer -->
<!-- for EmbeddedZkServer -->
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
</dependency>
<!-- end: for EmbeddedZkServer -->
<!-- default package with log4j -->
<dependency>
<groupId>org.slf4j</groupId>

View File

@ -62,6 +62,7 @@
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client-runtime</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>

View File

@ -51,6 +51,7 @@
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client-runtime</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>

188
pom.xml
View File

@ -63,10 +63,8 @@
<commons-codec.version>1.15</commons-codec.version>
<commons-collections.version>3.2.2</commons-collections.version>
<commons-lang3.version>3.10</commons-lang3.version>
<commons.httpclient.version>4.5.6</commons.httpclient.version>
<commons.httpcore.version>4.4.12</commons.httpcore.version>
<guava.version>24.1.1-jre</guava.version>
<curator.version>2.12.0</curator.version>
<guava.version>30.1-jre</guava.version>
<hadoop.version>3.2.2</hadoop.version>
<hive.version>2.3.7</hive.version>
<spark.version>3.0.2</spark.version>
@ -187,138 +185,51 @@
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<artifactId>hadoop-client-api</artifactId>
<version>${hadoop.version}</version>
</dependency>
<!--
Curator has a hard dependency on Guava, see detail at
https://cwiki.apache.org/confluence/display/CURATOR/TN13
-->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<exclusions>
<exclusion>
<groupId>com.sun.jersey</groupId>
<artifactId>*</artifactId>
<artifactId>checker-qual</artifactId>
<groupId>org.checkerframework</groupId>
</exclusion>
<exclusion>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<artifactId>error_prone_annotations</artifactId>
<groupId>com.google.errorprone</groupId>
</exclusion>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<artifactId>j2objc-annotations</artifactId>
<groupId>com.google.j2objc</groupId>
</exclusion>
<exclusion>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
</exclusion>
<exclusion>
<groupId>org.mortbay.jetty</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.htrace</groupId>
<artifactId>htrace-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
</exclusion>
<exclusion>
<groupId>xmlenc</groupId>
<artifactId>xmlenc</artifactId>
</exclusion>
<exclusion>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>net.java.dev.jets3t</groupId>
<artifactId>jets3t</artifactId>
</exclusion>
<exclusion>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</exclusion>
<exclusion>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<groupId>com.google.code.findbugs</groupId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<artifactId>listenablefuture</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client-api</artifactId>
<version>${hadoop.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client-runtime</artifactId>
<version>${hadoop.version}</version>
</dependency>
<!-- align with hadoop-common to avoid potential conflict -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
@ -344,18 +255,6 @@
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${commons.httpclient.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>${commons.httpcore.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_${scala.binary.version}</artifactId>
@ -660,14 +559,6 @@
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
</exclusion>
</exclusions>
</dependency>
@ -793,6 +684,10 @@
<groupId>tomcat</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
@ -940,6 +835,10 @@
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
@ -960,6 +859,10 @@
<artifactId>curator-client</artifactId>
<version>${curator.version}</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
@ -1032,22 +935,9 @@
<artifactId>zookeeper</artifactId>
<version>${zookeeper.version}</version>
<exclusions>
<!-- netty3 used only in Zookeeper Server -->
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>