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

jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new 0af3353fb [#4520] Imporvement(jdbc-catalogs): Shrink JDBC catalog 
binary package size to about 3MB. (#4521)
0af3353fb is described below

commit 0af3353fb289bf8c65693fec2fc56e11d0f300e3
Author: Qi Yu <[email protected]>
AuthorDate: Mon Aug 26 18:58:16 2024 +0800

    [#4520] Imporvement(jdbc-catalogs): Shrink JDBC catalog binary package size 
to about 3MB. (#4521)
    
    ### What changes were proposed in this pull request?
    
    Remove some unnecessary jar dependencies in the runtime classpath for
    JDBC catalogs.
    
    ### Why are the changes needed?
    
    Shrink JDBC catalog package.
    
    Fix: #4520
    
    ### Does this PR introduce _any_ user-facing change?
    
    N/A.
    ### How was this patch tested?
    
    Test locally and CI.
    
    MySQL catalog:
    
    
![image](https://github.com/user-attachments/assets/ddd24475-e7c7-4900-9ec8-6b2dba25882e)
    
    PostgreSQL catalog:
    
    <img width="1315" alt="image"
    
src="https://github.com/user-attachments/assets/548121c6-a940-455a-83dc-e14f3f7788ee";>
    Doris catalog:
    
    
    
![image](https://github.com/user-attachments/assets/c952f112-c4f1-404e-8709-56be8b8e7214)
    
    ---------
    
    Co-authored-by: Jerry Shao <[email protected]>
---
 catalogs/catalog-jdbc-doris/build.gradle.kts      | 26 +++++++++++-------
 catalogs/catalog-jdbc-mysql/build.gradle.kts      | 32 +++++++++++++++--------
 catalogs/catalog-jdbc-postgresql/build.gradle.kts | 27 ++++++++++++-------
 3 files changed, 55 insertions(+), 30 deletions(-)

diff --git a/catalogs/catalog-jdbc-doris/build.gradle.kts 
b/catalogs/catalog-jdbc-doris/build.gradle.kts
index 19f232bc6..b7cf6dfc8 100644
--- a/catalogs/catalog-jdbc-doris/build.gradle.kts
+++ b/catalogs/catalog-jdbc-doris/build.gradle.kts
@@ -25,17 +25,23 @@ plugins {
 }
 
 dependencies {
-  implementation(project(":api"))
-  implementation(project(":catalogs:catalog-jdbc-common"))
-  implementation(project(":common"))
-  implementation(project(":core"))
+  implementation(project(":api")) {
+    exclude(group = "*")
+  }
+  implementation(project(":catalogs:catalog-jdbc-common")) {
+    exclude(group = "*")
+  }
+  implementation(project(":common")) {
+    exclude(group = "*")
+  }
+  implementation(project(":core")) {
+    exclude(group = "*")
+  }
 
   implementation(libs.bundles.log4j)
   implementation(libs.commons.collections4)
   implementation(libs.commons.lang3)
   implementation(libs.guava)
-  implementation(libs.jsqlparser)
-  implementation(libs.slf4j.api)
 
   testImplementation(project(":catalogs:catalog-jdbc-common", "testArtifacts"))
   testImplementation(project(":clients:client-java"))
@@ -43,8 +49,6 @@ dependencies {
   testImplementation(project(":server"))
   testImplementation(project(":server-common"))
 
-  testImplementation(libs.commons.lang3)
-  testImplementation(libs.guava)
   testImplementation(libs.junit.jupiter.api)
   testImplementation(libs.junit.jupiter.params)
   testImplementation(libs.mysql.driver)
@@ -61,7 +65,11 @@ tasks {
   }
   val copyCatalogLibs by registering(Copy::class) {
     dependsOn("jar", "runtimeJars")
-    from("build/libs")
+    from("build/libs") {
+      exclude("guava-*.jar")
+      exclude("log4j-*.jar")
+      exclude("slf4j-*.jar")
+    }
     into("$rootDir/distribution/package/catalogs/jdbc-doris/libs")
   }
 
diff --git a/catalogs/catalog-jdbc-mysql/build.gradle.kts 
b/catalogs/catalog-jdbc-mysql/build.gradle.kts
index e6ba106cd..9ad6c739a 100644
--- a/catalogs/catalog-jdbc-mysql/build.gradle.kts
+++ b/catalogs/catalog-jdbc-mysql/build.gradle.kts
@@ -25,18 +25,26 @@ plugins {
 }
 
 dependencies {
-  implementation(project(":api"))
-  implementation(project(":catalogs:catalog-common"))
-  implementation(project(":catalogs:catalog-jdbc-common"))
-  implementation(project(":common"))
-  implementation(project(":core"))
+  implementation(project(":api")) {
+    exclude(group = "*")
+  }
+  implementation(project(":catalogs:catalog-common")) {
+    exclude(group = "*")
+  }
+  implementation(project(":catalogs:catalog-jdbc-common")) {
+    exclude(group = "*")
+  }
+  implementation(project(":common")) {
+    exclude(group = "*")
+  }
+  implementation(project(":core")) {
+    exclude(group = "*")
+  }
 
   implementation(libs.bundles.log4j)
   implementation(libs.commons.collections4)
   implementation(libs.commons.lang3)
   implementation(libs.guava)
-  implementation(libs.jsqlparser)
-  implementation(libs.slf4j.api)
 
   testImplementation(project(":catalogs:catalog-jdbc-common", "testArtifacts"))
   testImplementation(project(":clients:client-java"))
@@ -44,11 +52,9 @@ dependencies {
   testImplementation(project(":server"))
   testImplementation(project(":server-common"))
 
-  testImplementation(libs.commons.lang3)
-  testImplementation(libs.guava)
-  testImplementation(libs.mysql.driver)
   testImplementation(libs.junit.jupiter.api)
   testImplementation(libs.junit.jupiter.params)
+  testImplementation(libs.mysql.driver)
   testImplementation(libs.testcontainers)
   testImplementation(libs.testcontainers.mysql)
 
@@ -63,7 +69,11 @@ tasks {
 
   val copyCatalogLibs by registering(Copy::class) {
     dependsOn("jar", "runtimeJars")
-    from("build/libs")
+    from("build/libs") {
+      exclude("guava-*.jar")
+      exclude("log4j-*.jar")
+      exclude("slf4j-*.jar")
+    }
     into("$rootDir/distribution/package/catalogs/jdbc-mysql/libs")
   }
 
diff --git a/catalogs/catalog-jdbc-postgresql/build.gradle.kts 
b/catalogs/catalog-jdbc-postgresql/build.gradle.kts
index 8a03e6c18..70ffcfba5 100644
--- a/catalogs/catalog-jdbc-postgresql/build.gradle.kts
+++ b/catalogs/catalog-jdbc-postgresql/build.gradle.kts
@@ -26,16 +26,23 @@ plugins {
 
 dependencies {
 
-  implementation(project(":api"))
-  implementation(project(":catalogs:catalog-jdbc-common"))
-  implementation(project(":common"))
-  implementation(project(":core"))
+  implementation(project(":api")) {
+    exclude(group = "*")
+  }
+  implementation(project(":catalogs:catalog-jdbc-common")) {
+    exclude(group = "*")
+  }
+  implementation(project(":common")) {
+    exclude(group = "*")
+  }
+  implementation(project(":core")) {
+    exclude(group = "*")
+  }
 
   implementation(libs.bundles.log4j)
   implementation(libs.commons.collections4)
   implementation(libs.commons.lang3)
   implementation(libs.guava)
-  implementation(libs.jsqlparser)
 
   testImplementation(project(":catalogs:catalog-jdbc-common", "testArtifacts"))
   testImplementation(project(":clients:client-java"))
@@ -43,14 +50,10 @@ dependencies {
   testImplementation(project(":server"))
   testImplementation(project(":server-common"))
 
-  testImplementation(libs.bundles.log4j)
-  testImplementation(libs.commons.lang3)
-  testImplementation(libs.guava)
   testImplementation(libs.junit.jupiter.api)
   testImplementation(libs.junit.jupiter.params)
   testImplementation(libs.mysql.driver)
   testImplementation(libs.postgresql.driver)
-  testImplementation(libs.slf4j.api)
   testImplementation(libs.testcontainers)
   testImplementation(libs.testcontainers.mysql)
   testImplementation(libs.testcontainers.postgresql)
@@ -66,7 +69,11 @@ tasks {
 
   val copyCatalogLibs by registering(Copy::class) {
     dependsOn("jar", "runtimeJars")
-    from("build/libs")
+    from("build/libs") {
+      exclude("guava-*.jar")
+      exclude("log4j-*.jar")
+      exclude("slf4j-*.jar")
+    }
     into("$rootDir/distribution/package/catalogs/jdbc-postgresql/libs")
   }
 

Reply via email to