diff --git a/client-spark/extension/pom.xml b/client-spark/extension/pom.xml
index ff0511eba9..f523a10584 100644
--- a/client-spark/extension/pom.xml
+++ b/client-spark/extension/pom.xml
@@ -33,6 +33,31 @@
jarApache Uniffle Client spark ui
+
+
+
+ src/main/scala-javax
+
+
org.apache.uniffle
@@ -72,6 +97,24 @@
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+
+
+ add-servlet-compat-source
+ generate-sources
+
+ add-source
+
+
+
+ ${extension.servlet.source.dir}
+
+
+
+
+ net.alchim31.mavenscala-maven-plugin
@@ -90,4 +133,14 @@
+
+
+
+
+ spark4
+
+ src/main/scala-jakarta
+
+
+
diff --git a/client-spark/extension/src/main/scala-jakarta/org/apache/spark/ui/ServletCompat.scala b/client-spark/extension/src/main/scala-jakarta/org/apache/spark/ui/ServletCompat.scala
new file mode 100644
index 0000000000..aa92fff580
--- /dev/null
+++ b/client-spark/extension/src/main/scala-jakarta/org/apache/spark/ui/ServletCompat.scala
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.ui
+
+// jakarta.servlet variant of ServletCompat, picked up by the spark4
+// profile (see client-spark/extension/pom.xml). Every alias here must
+// also exist in the scala-javax/ variant — only the underlying servlet
+// package may differ.
+private[ui] object ServletCompat {
+ type HttpServletRequest = jakarta.servlet.http.HttpServletRequest
+}
diff --git a/client-spark/extension/src/main/scala-javax/org/apache/spark/ui/ServletCompat.scala b/client-spark/extension/src/main/scala-javax/org/apache/spark/ui/ServletCompat.scala
new file mode 100644
index 0000000000..c672209847
--- /dev/null
+++ b/client-spark/extension/src/main/scala-javax/org/apache/spark/ui/ServletCompat.scala
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.ui
+
+// javax.servlet variant of ServletCompat, picked up by the default
+// ${extension.servlet.source.dir} (see client-spark/extension/pom.xml).
+// Every alias here must also exist in the scala-jakarta/ variant —
+// only the underlying servlet package may differ.
+private[ui] object ServletCompat {
+ type HttpServletRequest = javax.servlet.http.HttpServletRequest
+}
diff --git a/client-spark/extension/src/main/scala/org/apache/spark/ui/ShufflePage.scala b/client-spark/extension/src/main/scala/org/apache/spark/ui/ShufflePage.scala
index edfc1740b7..dcc700cbae 100644
--- a/client-spark/extension/src/main/scala/org/apache/spark/ui/ShufflePage.scala
+++ b/client-spark/extension/src/main/scala/org/apache/spark/ui/ShufflePage.scala
@@ -18,11 +18,11 @@
package org.apache.spark.ui
import org.apache.spark.internal.Logging
+import org.apache.spark.ui.ServletCompat.HttpServletRequest
import org.apache.spark.util.Utils
import org.apache.spark.{AggregatedShuffleMetric, AggregatedShuffleReadMetric, AggregatedShuffleWriteMetric, AggregatedTaskInfoUIData, ShuffleType}
import java.util.concurrent.ConcurrentHashMap
-import javax.servlet.http.HttpServletRequest
import scala.collection.JavaConverters.{collectionAsScalaIterableConverter, mapAsScalaMapConverter}
import scala.xml.{Node, NodeSeq}
diff --git a/client-spark/spark4/pom.xml b/client-spark/spark4/pom.xml
index 8ff70fc506..0c738ca816 100644
--- a/client-spark/spark4/pom.xml
+++ b/client-spark/spark4/pom.xml
@@ -59,6 +59,11 @@
rss-client-spark-common${project.version}
+
+ org.apache.uniffle
+ rss-client-spark-ui
+ ${project.version}
+ io.nettynetty-all
diff --git a/pom.xml b/pom.xml
index ee2faa04f1..b178dc2127 100644
--- a/pom.xml
+++ b/pom.xml
@@ -945,7 +945,7 @@
org.codehaus.mojobuild-helper-maven-plugin
- 1.10
+ 3.6.0org.codehaus.mojo
@@ -2008,6 +2008,7 @@
client-spark/spark4-shadedintegration-test/spark-commonintegration-test/spark4
+ client-spark/extension