You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ya...@apache.org on 2025/03/26 15:56:46 UTC

(spark) branch branch-4.0 updated: [SPARK-51607][CONNECT][BUILD] Set `combine.self = "override"` to configuration of `maven-shade-plugin` in `connect` modules

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

yangjie01 pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 2380e88ebcb0 [SPARK-51607][CONNECT][BUILD] Set `combine.self = "override"` to configuration of `maven-shade-plugin` in `connect` modules
2380e88ebcb0 is described below

commit 2380e88ebcb0c3676aac5e82b1391c6a2431265e
Author: yangjie01 <ya...@baidu.com>
AuthorDate: Wed Mar 26 23:55:47 2025 +0800

    [SPARK-51607][CONNECT][BUILD] Set `combine.self = "override"` to configuration of `maven-shade-plugin` in `connect` modules
    
    ### What changes were proposed in this pull request?
    Similar to the situation in SPARK-50166, for modules that have independently configured shading and relocation rules, the `configuration` tag of `maven-shade-plugin` should be set with `combine.self = "override"`. This pull request makes similar modifications to three modules related to connect.
    
    ### Why are the changes needed?
    Avoid the `maven-shade-plugin` configuration in connect-related modules from being affected by the default configuration in the parent `pom.xml`.
    
    For example, before this pull request, the `com.google.common.cache.{CacheBuilder, CacheLoader}` referenced in `org.apache.spark.sql.connect.SparkSession` was relocated to `org/sparkproject/guava` (as configured in the parent `pom.xml`) instead of the desired `org/sparkproject/connect/guava`. We can verify this by unpacking the resulting jar and using the `grep` command:
    
    ```
    grep -R "org/sparkproject/guava" *
    Binary file tmp/org/apache/spark/connect/proto/SparkConnectServiceGrpc$SparkConnectServiceFutureStub.class matches
    Binary file tmp/org/apache/spark/sql/connect/SparkSession$Builder.class matches
    Binary file tmp/org/apache/spark/sql/connect/SparkSession$.class matches
    Binary file tmp/org/apache/spark/sql/connect/SparkSession$$anon$1.class matches
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    - Pass Git Hub Acitons
    - build a client using dev/make-distribution.sh --tgz -Phive with this pr, checked `bin/spark-shell --remote local`
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No
    
    Closes #50401 from LuciferYang/connect-combin-self-override.
    
    Authored-by: yangjie01 <ya...@baidu.com>
    Signed-off-by: yangjie01 <ya...@baidu.com>
    (cherry picked from commit 57cf2360bcb2517eb6755842bbc52a52bffc1c03)
    Signed-off-by: yangjie01 <ya...@baidu.com>
---
 sql/connect/client/jvm/pom.xml | 2 +-
 sql/connect/common/pom.xml     | 2 +-
 sql/connect/server/pom.xml     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sql/connect/client/jvm/pom.xml b/sql/connect/client/jvm/pom.xml
index d5b8ee6e1c44..d3daf91dff40 100644
--- a/sql/connect/client/jvm/pom.xml
+++ b/sql/connect/client/jvm/pom.xml
@@ -143,7 +143,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
-        <configuration>
+        <configuration combine.self = "override">
           <shadedArtifactAttached>false</shadedArtifactAttached>
           <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
           <artifactSet>
diff --git a/sql/connect/common/pom.xml b/sql/connect/common/pom.xml
index d26800749822..3b275e453d3a 100644
--- a/sql/connect/common/pom.xml
+++ b/sql/connect/common/pom.xml
@@ -136,7 +136,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-shade-plugin</artifactId>
-                <configuration>
+                <configuration combine.self = "override">
                     <shadedArtifactAttached>false</shadedArtifactAttached>
                     <artifactSet>
                         <includes>
diff --git a/sql/connect/server/pom.xml b/sql/connect/server/pom.xml
index eb32bfdae95b..5a56bafadb80 100644
--- a/sql/connect/server/pom.xml
+++ b/sql/connect/server/pom.xml
@@ -306,7 +306,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
-        <configuration>
+        <configuration combine.self = "override">
           <shadedArtifactAttached>false</shadedArtifactAttached>
           <artifactSet>
             <includes>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org