geyanggang commented on code in PR #10789:
URL: https://github.com/apache/gravitino/pull/10789#discussion_r3121393585


##########
flink-connector/flink/build.gradle.kts:
##########
@@ -141,9 +141,15 @@ dependencies {
     exclude("javax.servlet", "servlet-api")
     exclude("org.mortbay.jetty")
   }
-  testImplementation(libs.hadoop2.mapreduce.client.core) {
+  testImplementation(libs.hadoop3.hdfs.client)
+  testImplementation(libs.hadoop3.mapreduce.client.core) {
     exclude("*")
   }
+  // Hadoop 3.x runtime requirements (stripped by exclude("*") above)
+  testImplementation(libs.hadoop3.shaded.guava)
+  testImplementation(libs.hadoop3.shaded.protobuf)
+  testImplementation("org.apache.commons:commons-configuration2:2.8.0")
+  testImplementation(libs.re2j)

Review Comment:
   Yes, this is expected. Hadoop 2.x bundled everything inside `hadoop-common`. 
Hadoop 3.x extracted several internal dependencies into separate artifacts:
   
   - `hadoop-shaded-guava` — Guava relocated to avoid conflicts
   - `hadoop-shaded-protobuf` — Protobuf relocated
   - `commons-configuration2` — replaced `commons-configuration` 1.x
   - `re2j` — new dependency used by `Globber.doGlob()` since 3.3.6
   
   Since we use `exclude("*")` to strip all transitives from `hadoop-common`, 
these must be declared explicitly. Without them, you get `NoClassDefFoundError` 
at runtime.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to