This is an automated email from the ASF dual-hosted git repository.
yangjie01 pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new 425fbafed1e1 [SPARK-54177][BUILD][FOLLOWUP] Restore Guava exclusion
from connect-common shading artifacts
425fbafed1e1 is described below
commit 425fbafed1e1d27948339f0c9a3b2a802fc9e4d1
Author: Cheng Pan <[email protected]>
AuthorDate: Thu Nov 6 20:51:34 2025 +0800
[SPARK-54177][BUILD][FOLLOWUP] Restore Guava exclusion from connect-common
shading artifacts
### What changes were proposed in this pull request?
This PR restores the Guava exclusion from the `connect-common` module
shading artifacts
### Why are the changes needed?
To workaround a Maven-specific tricky classpath issue, see the manual
verification steps below for details.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
GHA Maven workflow runs multiple connect modules together `-pl
sql/connect/client/jdbc,sql/connect/client/jvm,sql/connect/common,sql/connect/server`
so it is not affected by this.
This must be verified manually:
```
build/mvn -Phive clean install -DskipTests
```
run `connect-common` and `connect-client-jvm` tests together, succeeded on
both the master and this PR
```
build/mvn -Phive -pl sql/connect/client/jvm,sql/connect/common test -fae
-DwildcardSuites=none -Dtest=org.apache.spark.sql.JavaEncoderSuite
```
run single `connect-client-jvm` tests, failed on the master, succeeded on
this PR
```
build/mvn -Phive -pl sql/connect/client/jvm test -fae -DwildcardSuites=none
-Dtest=org.apache.spark.sql.JavaEncoderSuite
```
```
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:
0.369 s <<< FAILURE! -- in org.apache.spark.sql.JavaEncoderSuite
[ERROR] org.apache.spark.sql.JavaEncoderSuite -- Time elapsed: 0.369 s <<<
ERROR!
java.lang.NoClassDefFoundError: org/sparkproject/guava/cache/CacheLoader
at
org.apache.spark.sql.connect.test.SparkConnectServerUtils$.createSparkSession(RemoteSparkSession.scala:208)
at
org.apache.spark.sql.connect.test.SparkConnectServerUtils$.createSparkSession(RemoteSparkSession.scala:190)
at
org.apache.spark.sql.connect.test.SparkConnectServerUtils.createSparkSession(RemoteSparkSession.scala)
at
org.apache.spark.sql.JavaEncoderSuite.setup(JavaEncoderSuite.java:45)
Caused by: java.lang.ClassNotFoundException:
org.sparkproject.guava.cache.CacheLoader
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 4 more
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] JavaEncoderSuite.setup:45 ยป NoClassDefFound
org/sparkproject/guava/cache/CacheLoader
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
```
```
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
23.00 s -- in org.apache.spark.sql.JavaEncoderSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
```
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #52918 from pan3793/SPARK-54177-followup.
Authored-by: Cheng Pan <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
(cherry picked from commit b3abaecf30ec3030a0ff4081e711b1a285b06352)
Signed-off-by: yangjie01 <[email protected]>
---
sql/connect/common/pom.xml | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/sql/connect/common/pom.xml b/sql/connect/common/pom.xml
index 2713f23c51e6..7e91b056de55 100644
--- a/sql/connect/common/pom.xml
+++ b/sql/connect/common/pom.xml
@@ -121,6 +121,31 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <!--
+ Explicitly override the included artifacts without Guava, to
workaround
+ classpath issues on executing tests with single
connect-client-jvm using
+ Maven. See SPARK-54177 for more details.
+ -->
+ <configuration combine.self = "override">
+ <shadedArtifactAttached>false</shadedArtifactAttached>
+ <artifactSet>
+ <includes>
+ <include>org.spark-project.spark:unused</include>
+ </includes>
+ </artifactSet>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<profiles>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]