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

eolivelli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 429f7de9682 [improve][client] Reduce unshaded dependencies and shading 
warnings in shaded Java client modules (#23647)
429f7de9682 is described below

commit 429f7de96826d20bc90eb54a3b40df0e31f4b42f
Author: Lari Hotari <[email protected]>
AuthorDate: Fri Nov 29 11:17:08 2024 +0200

    [improve][client] Reduce unshaded dependencies and shading warnings in 
shaded Java client modules (#23647)
---
 distribution/server/src/assemble/LICENSE.bin.txt   |   2 -
 distribution/shell/src/assemble/LICENSE.bin.txt    |   3 -
 jetcd-core-shaded/pom.xml                          |   4 +
 pom.xml                                            |  30 +-
 pulsar-broker-auth-oidc/pom.xml                    |   4 +
 pulsar-broker-common/pom.xml                       |   4 +-
 pulsar-broker/pom.xml                              |   4 +-
 pulsar-client-admin-shaded/pom.xml                 | 311 ++++++++++++--------
 ...e.pulsar.shade.javax.ws.rs.client.ClientBuilder |   1 +
 ...he.pulsar.shade.javax.ws.rs.ext.RuntimeDelegate |   1 +
 pulsar-client-admin/pom.xml                        |   4 +-
 pulsar-client-all/pom.xml                          | 312 ++++++++++++---------
 ...e.pulsar.shade.javax.ws.rs.client.ClientBuilder |   1 +
 ...he.pulsar.shade.javax.ws.rs.ext.RuntimeDelegate |   1 +
 pulsar-client-auth-athenz/pom.xml                  |   5 +
 pulsar-client-auth-sasl/pom.xml                    |   4 +-
 pulsar-client-shaded/pom.xml                       | 240 +++++++++-------
 pulsar-common/pom.xml                              |   4 +-
 pulsar-functions/proto/pom.xml                     |   6 +-
 pulsar-functions/runtime/pom.xml                   |   6 +-
 pulsar-functions/secrets/pom.xml                   |   6 +-
 pulsar-proxy/pom.xml                               |   4 +-
 tiered-storage/jcloud/pom.xml                      |   4 +-
 23 files changed, 580 insertions(+), 381 deletions(-)

diff --git a/distribution/server/src/assemble/LICENSE.bin.txt 
b/distribution/server/src/assemble/LICENSE.bin.txt
index 10899bc0ae7..21422a41dce 100644
--- a/distribution/server/src/assemble/LICENSE.bin.txt
+++ b/distribution/server/src/assemble/LICENSE.bin.txt
@@ -571,10 +571,8 @@ Protocol Buffers License
 CDDL-1.1 -- ../licenses/LICENSE-CDDL-1.1.txt
  * Java Annotations API
     - com.sun.activation-javax.activation-1.2.0.jar
-    - javax.xml.bind-jaxb-api-2.3.1.jar
  * Java Servlet API -- javax.servlet-javax.servlet-api-3.1.0.jar
  * WebSocket Server API -- javax.websocket-javax.websocket-client-api-1.0.jar
- * Java Web Service REST API -- javax.ws.rs-javax.ws.rs-api-2.1.jar
  * HK2 - Dependency Injection Kernel
     - org.glassfish.hk2-hk2-api-2.6.1.jar
     - org.glassfish.hk2-hk2-locator-2.6.1.jar
diff --git a/distribution/shell/src/assemble/LICENSE.bin.txt 
b/distribution/shell/src/assemble/LICENSE.bin.txt
index 07a40d3bc1b..a21c272f91b 100644
--- a/distribution/shell/src/assemble/LICENSE.bin.txt
+++ b/distribution/shell/src/assemble/LICENSE.bin.txt
@@ -431,11 +431,8 @@ MIT License
 
 CDDL-1.1 -- ../licenses/LICENSE-CDDL-1.1.txt
  * Java Annotations API
-    - javax.annotation-api-1.3.2.jar
     - javax.activation-1.2.0.jar
-    - jaxb-api-2.3.1.jar
  * WebSocket Server API -- javax.websocket-client-api-1.0.jar
- * Java Web Service REST API -- javax.ws.rs-api-2.1.jar
  * HK2 - Dependency Injection Kernel
     - hk2-api-2.6.1.jar
     - hk2-locator-2.6.1.jar
diff --git a/jetcd-core-shaded/pom.xml b/jetcd-core-shaded/pom.xml
index 0b79df8278f..2a5536987cd 100644
--- a/jetcd-core-shaded/pom.xml
+++ b/jetcd-core-shaded/pom.xml
@@ -45,6 +45,10 @@
           <groupId>io.netty</groupId>
           <artifactId>*</artifactId>
         </exclusion>
+        <exclusion>
+          <groupId>javax.annotation</groupId>
+          <artifactId>javax.annotation-api</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
     <dependency>
diff --git a/pom.xml b/pom.xml
index 4830358f5ea..54744a253bb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -220,7 +220,7 @@ flexible messaging model and an intuitive client 
API.</description>
     <commons-configuration.version>1.10</commons-configuration.version>
     <commons-io.version>2.14.0</commons-io.version>
     <commons-codec.version>1.15</commons-codec.version>
-    <javax.ws.rs-api.version>2.1</javax.ws.rs-api.version>
+    <jakarta.ws.rs-api.version>2.1.6</jakarta.ws.rs-api.version>
     <hdrHistogram.version>2.1.9</hdrHistogram.version>
     <javax.servlet-api>3.1.0</javax.servlet-api>
     <caffeine.version>2.9.1</caffeine.version>
@@ -231,7 +231,7 @@ flexible messaging model and an intuitive client 
API.</description>
     <spark-streaming_2.10.version>2.1.0</spark-streaming_2.10.version>
     <assertj-core.version>3.24.2</assertj-core.version>
     <lombok.version>1.18.32</lombok.version>
-    <javax.annotation-api.version>1.3.2</javax.annotation-api.version>
+    <jakarta.annotation-api.version>1.3.5</jakarta.annotation-api.version>
     <jaxb-api>2.3.1</jaxb-api>
     <javax.activation.version>1.2.0</javax.activation.version>
     <jakarta.activation.version>1.2.2</jakarta.activation.version>
@@ -854,9 +854,9 @@ flexible messaging model and an intuitive client 
API.</description>
       </dependency>
 
       <dependency>
-        <groupId>javax.ws.rs</groupId>
-        <artifactId>javax.ws.rs-api</artifactId>
-        <version>${javax.ws.rs-api.version}</version>
+        <groupId>jakarta.ws.rs</groupId>
+        <artifactId>jakarta.ws.rs-api</artifactId>
+        <version>${jakarta.ws.rs-api.version}</version>
       </dependency>
 
       <dependency>
@@ -990,6 +990,12 @@ flexible messaging model and an intuitive client 
API.</description>
         <groupId>com.yahoo.athenz</groupId>
         <artifactId>athenz-zts-java-client-core</artifactId>
         <version>${athenz.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>javax.ws.rs-api</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
 
       <dependency>
@@ -1418,9 +1424,9 @@ flexible messaging model and an intuitive client 
API.</description>
       </dependency>
 
       <dependency>
-        <groupId>javax.annotation</groupId>
-        <artifactId>javax.annotation-api</artifactId>
-        <version>${javax.annotation-api.version}</version>
+        <groupId>jakarta.annotation</groupId>
+        <artifactId>jakarta.annotation-api</artifactId>
+        <version>${jakarta.annotation-api.version}</version>
       </dependency>
 
       <dependency>
@@ -1723,11 +1729,6 @@ flexible messaging model and an intuitive client 
API.</description>
       <artifactId>lombok</artifactId>
       <scope>provided</scope>
     </dependency>
-    <dependency>
-      <groupId>javax.annotation</groupId>
-      <artifactId>javax.annotation-api</artifactId>
-      <scope>provided</scope>
-    </dependency>
 
     <dependency>
       <!-- We use MockedBookKeeper in many unit tests -->
@@ -2003,6 +2004,9 @@ flexible messaging model and an intuitive client 
API.</description>
             <exclude>src/assemble/LICENSE.bin.txt</exclude>
             <exclude>src/assemble/NOTICE.bin.txt</exclude>
 
+            <!-- exclude services files -->
+            <exclude>**/META-INF/services/*</exclude>
+
             <!-- These files are generated automatically by the Protobuf 
compiler
                  and are included in source tree for convenience -->
             
<exclude>src/main/java/org/apache/bookkeeper/mledger/proto/MLDataFormats.java</exclude>
diff --git a/pulsar-broker-auth-oidc/pom.xml b/pulsar-broker-auth-oidc/pom.xml
index 72351bf47d2..2d0931c3f2d 100644
--- a/pulsar-broker-auth-oidc/pom.xml
+++ b/pulsar-broker-auth-oidc/pom.xml
@@ -95,6 +95,10 @@
           <artifactId>bcprov-jdk18on</artifactId>
           <groupId>org.bouncycastle</groupId>
         </exclusion>
+        <exclusion>
+          <groupId>javax.annotation</groupId>
+          <artifactId>javax.annotation-api</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
 
diff --git a/pulsar-broker-common/pom.xml b/pulsar-broker-common/pom.xml
index 30b703cd78a..858a234a32d 100644
--- a/pulsar-broker-common/pom.xml
+++ b/pulsar-broker-common/pom.xml
@@ -60,8 +60,8 @@
     </dependency>
 
     <dependency>
-      <groupId>javax.ws.rs</groupId>
-      <artifactId>javax.ws.rs-api</artifactId>
+      <groupId>jakarta.ws.rs</groupId>
+      <artifactId>jakarta.ws.rs-api</artifactId>
     </dependency>
 
     <dependency>
diff --git a/pulsar-broker/pom.xml b/pulsar-broker/pom.xml
index 97ede1f76e9..a34f5664470 100644
--- a/pulsar-broker/pom.xml
+++ b/pulsar-broker/pom.xml
@@ -446,8 +446,8 @@
     </dependency>
 
     <dependency>
-      <groupId>javax.xml.bind</groupId>
-      <artifactId>jaxb-api</artifactId>
+      <groupId>jakarta.xml.bind</groupId>
+      <artifactId>jakarta.xml.bind-api</artifactId>
       <exclusions>
         <exclusion>
           <groupId>javax.activation</groupId>
diff --git a/pulsar-client-admin-shaded/pom.xml 
b/pulsar-client-admin-shaded/pom.xml
index ab42f0e2aef..74ced063fbf 100644
--- a/pulsar-client-admin-shaded/pom.xml
+++ b/pulsar-client-admin-shaded/pom.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" ?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -19,19 +19,16 @@
     under the License.
 
 -->
-<project
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";
-  xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.pulsar</groupId>
     <artifactId>pulsar</artifactId>
     <version>4.1.0-SNAPSHOT</version>
   </parent>
-
   <artifactId>pulsar-client-admin</artifactId>
   <name>Pulsar Client Admin</name>
-
   <dependencies>
     <dependency>
       <groupId>${project.groupId}</groupId>
@@ -73,7 +70,6 @@
           </execution>
         </executions>
       </plugin>
-
       <plugin>
         <artifactId>maven-antrun-plugin</artifactId>
         <executions>
@@ -86,15 +82,13 @@
             <configuration>
               <target>
                 <!-- shade the AsyncHttpClient ahc-default.properties files -->
-                <replace token= "org.asynchttpclient."
-                         value="org.apache.pulsar.shade.org.asynchttpclient."
-                         
file="${project.build.directory}/classes/org/asynchttpclient/config/ahc-default.properties"/>
+                <replace 
file="${project.build.directory}/classes/org/asynchttpclient/config/ahc-default.properties"
+                         token="org.asynchttpclient." 
value="org.apache.pulsar.shade.org.asynchttpclient."/>
               </target>
             </configuration>
           </execution>
         </executions>
       </plugin>
-
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
@@ -107,48 +101,55 @@
             <configuration>
               <createDependencyReducedPom>true</createDependencyReducedPom>
               
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
-
               <artifactSet>
                 <includes>
-                  <include>org.apache.pulsar:pulsar-client-original</include>
-                  
<include>org.apache.pulsar:pulsar-client-admin-original</include>
-                  <include>org.apache.commons:commons-lang3</include>
-                  <include>commons-codec:commons-codec</include>
-                  <include>commons-collections:commons-collections</include>
-                  <include>org.asynchttpclient:*</include>
-                  <include>org.reactivestreams:reactive-streams</include>
-                  <include>com.typesafe.netty:netty-reactive-streams</include>
-                  <include>org.javassist:javassist</include>
-                  <include>com.google.guava:guava</include>
+                  <include>com.fasterxml.jackson.*:*</include>
+                  <include>com.google.*:*</include>
+                  <include>com.google.auth:*</include>
                   <include>com.google.code.gson:gson</include>
+                  <include>com.google.guava:guava</include>
                   <include>com.google.re2j:re2j</include>
                   <include>com.spotify:completable-futures</include>
-                  <include>com.fasterxml.jackson.*:*</include>
-                  <include>io.netty:*</include>
-                  <include>io.netty.incubator:*</include>
-                  <include>org.apache.pulsar:pulsar-common</include>
-                  <include>org.apache.bookkeeper:*</include>
+                  <include>com.squareup.*:*</include>
+                  <include>com.sun.activation:javax.activation</include>
+                  <include>com.typesafe.netty:netty-reactive-streams</include>
+                  <include>com.yahoo.datasketches:*</include>
                   <include>com.yahoo.datasketches:sketches-core</include>
-                  <include>org.glassfish.jersey*:*</include>
-                  <include>javax.ws.rs:*</include>
-                  <include>javax.xml.bind:jaxb-api</include>
-                  <include>jakarta.annotation:*</include>
-                  <include>org.glassfish.hk2*:*</include>
+                  <include>commons-*:*</include>
+                  <include>commons-codec:commons-codec</include>
+                  <include>commons-collections:commons-collections</include>
+                  <include>io.airlift:*</include>
                   <include>io.grpc:*</include>
+                  <include>io.netty.incubator:*</include>
+                  <include>io.netty:*</include>
+                  <include>io.opencensus:*</include>
                   <include>io.perfmark:*</include>
-                  <include>com.yahoo.datasketches:*</include>
-                  <include>com.squareup.*:*</include>
-                  <include>com.google.*:*</include>
-                  <include>commons-*:*</include>
+                  <include>io.swagger:*</include>
+                  <include>jakarta.activation:jakarta.activation-api</include>
+                  <include>jakarta.annotation:jakarta.annotation-api</include>
+                  <include>jakarta.ws.rs:jakarta.ws.rs-api</include>
+                  <include>jakarta.xml.bind:jakarta.xml.bind-api</include>
+                  <include>javax.ws.rs:*</include>
+                  <include>javax.xml.bind:jaxb-api</include>
+                  <include>net.jcip:jcip-annotations</include>
+                  <include>org.apache.bookkeeper:*</include>
+                  <include>org.apache.commons:commons-compress</include>
+                  <include>org.apache.commons:commons-lang3</include>
+                  
<include>org.apache.pulsar:pulsar-client-admin-original</include>
+                  <!-- Issue #6834, Since Netty ByteBuf shaded, we need also 
shade this module -->
+                  
<include>org.apache.pulsar:pulsar-client-messagecrypto-bc</include>
+                  <include>org.apache.pulsar:pulsar-client-original</include>
+                  <include>org.apache.pulsar:pulsar-common</include>
+                  <include>org.asynchttpclient:*</include>
+                  <include>org.checkerframework:*</include>
                   <include>org.eclipse.jetty:*</include>
-                  <include>com.google.auth:*</include>
+                  <include>org.glassfish.hk2*:*</include>
+                  <include>org.glassfish.jersey*:*</include>
+                  <include>org.javassist:javassist</include>
                   <include>org.jvnet.mimepull:*</include>
-                  <include>io.opencensus:*</include>
                   <include>org.objenesis:*</include>
+                  <include>org.reactivestreams:reactive-streams</include>
                   <include>org.yaml:snakeyaml</include>
-                  <include>io.swagger:*</include>
-                  <!-- Issue #6834, Since Netty ByteBuf shaded, we need also 
shade this module -->
-                  
<include>org.apache.pulsar:pulsar-client-messagecrypto-bc</include>
                 </includes>
                 <excludes>
                   
<exclude>com.fasterxml.jackson.core:jackson-annotations</exclude>
@@ -162,7 +163,7 @@
                     <include>**</include>
                   </includes>
                   <excludes>
-                    <!-- bouncycastle jars could not be shaded, or the 
signatures will be wrong-->
+                    <!-- bouncycastle jars could not be shaded, or the 
signatures will be wrong -->
                     <exclude>org/bouncycastle/**</exclude>
                   </excludes>
                 </filter>
@@ -172,19 +173,54 @@
                     <include>**</include>
                   </includes>
                   <excludes>
-                    <!-- bouncycastle jars could not be shaded, or the 
signatures will be wrong-->
+                    <!-- bouncycastle jars could not be shaded, or the 
signatures will be wrong -->
                     <exclude>org/bouncycastle/**</exclude>
                   </excludes>
                 </filter>
+                <filter>
+                  <artifact>org.asynchttpclient:async-http-client</artifact>
+                  <includes>
+                    <include>**</include>
+                  </includes>
+                  <excludes>
+                    
<exclude>org/asynchttpclient/config/ahc-default.properties</exclude>
+                  </excludes>
+                </filter>
+                <filter>
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>**/module-info.class</exclude>
+                    <exclude>findbugsExclude.xml</exclude>
+                    <exclude>META-INF/*-LICENSE</exclude>
+                    <exclude>META-INF/*-NOTICE</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/DEPENDENCIES*</exclude>
+                    <exclude>META-INF/io.netty.versions.properties</exclude>
+                    <exclude>META-INF/LICENSE*</exclude>
+                    <exclude>META-INF/license/**</exclude>
+                    <exclude>META-INF/MANIFEST.MF</exclude>
+                    <exclude>META-INF/maven/**</exclude>
+                    <exclude>META-INF/native-image/**</exclude>
+                    <exclude>META-INF/NOTICE*</exclude>
+                    <exclude>META-INF/proguard/**</exclude>
+                  </excludes>
+                </filter>
               </filters>
               <relocations>
-               <relocation>
-                  <pattern>org.asynchttpclient</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.asynchttpclient</shadedPattern>
+                <!-- Rename Netty native libraries to include the shaded 
prefix -->
+                <relocation>
+                  
<pattern>(META-INF/native/(lib)?)(netty.+\.(so|jnilib|dll))$</pattern>
+                  <shadedPattern>$1org_apache_pulsar_shade_$3</shadedPattern>
+                  <rawString>true</rawString>
                 </relocation>
                 <relocation>
-                  <pattern>org.apache.commons</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.commons</shadedPattern>
+                  <pattern>com.fasterxml.jackson</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.fasterxml.jackson</shadedPattern>
+                  <excludes>
+                    <exclude>com.fasterxml.jackson.annotation.*</exclude>
+                  </excludes>
                 </relocation>
                 <relocation>
                   <pattern>com.google</pattern>
@@ -198,44 +234,61 @@
                   
<shadedPattern>org.apache.pulsar.shade.com.spotify.futures</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>com.fasterxml.jackson</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.fasterxml.jackson</shadedPattern>
-                  <excludes>
-                    <exclude>com.fasterxml.jackson.annotation.*</exclude>
-                  </excludes>
+                  <pattern>com.squareup</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.squareup</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>io.netty</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.io.netty</shadedPattern>
+                  <pattern>com.sun.activation</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.sun.activation</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.apache.pulsar.policies</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.pulsar.policies</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>org.apache.pulsar.checksum</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.pulsar.checksum</shadedPattern>
+                  <pattern>com.typesafe</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.typesafe</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>com.yahoo</pattern>
                   
<shadedPattern>org.apache.pulsar.shade.com.yahoo</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>com.typesafe</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.typesafe</shadedPattern>
+                  <pattern>io.airlift</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.io.airlift</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.glassfish</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.glassfish</shadedPattern>
+                  <pattern>io.grpc</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.io.grpc</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>javax.ws</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.javax.ws</shadedPattern>
+                  <pattern>io.netty</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.io.netty</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>io.opencensus</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.io.opencensus</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>io.swagger</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.io.swagger</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javassist</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.javassist</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.activation</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.javax.activation</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>javax.annotation</pattern>
                   
<shadedPattern>org.apache.pulsar.shade.javax.annotation</shadedPattern>
                 </relocation>
+                <relocation>
+                  <pattern>javax.inject</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.javax.inject</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.ws</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.javax.ws</shadedPattern>
+                </relocation>
                 <relocation>
                   <pattern>javax.xml.bind</pattern>
                   
<shadedPattern>org.apache.pulsar.shade.javax.xml.bind</shadedPattern>
@@ -245,71 +298,95 @@
                   <shadedPattern>org.apache.pulsar.shade.jersey</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.jvnet</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.jvnet</shadedPattern>
+                  
<pattern>META-INF/versions/(\d+)/com/fasterxml/jackson/core/</pattern>
+                  
<shadedPattern>META-INF/versions/$1/org/apache/pulsar/shade/com/fasterxml/jackson/core/
+                  </shadedPattern>
+                  <rawString>true</rawString>
+                </relocation>
+                <relocation>
+                  <pattern>META-INF/versions/(\d+)/javax/xml/bind/</pattern>
+                  
<shadedPattern>META-INF/versions/$1/org/apache/pulsar/shade/javax/xml/bind/</shadedPattern>
+                  <rawString>true</rawString>
+                </relocation>
+                <relocation>
+                  <pattern>META-INF/versions/(\d+)/org/glassfish/</pattern>
+                  
<shadedPattern>META-INF/versions/$1/org/apache/pulsar/shade/org/glassfish/</shadedPattern>
+                  <rawString>true</rawString>
+                </relocation>
+                <relocation>
+                  <pattern>META-INF/versions/(\d+)/org/yaml/</pattern>
+                  
<shadedPattern>META-INF/versions/$1/org/apache/pulsar/shade/org/yaml/</shadedPattern>
+                  <rawString>true</rawString>
+                </relocation>
+                <relocation>
+                  <pattern>net.jcip</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.net.jcip</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>okio</pattern>
+                  <shadedPattern>org.apache.pulsar.shade.okio</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>org.aopalliance</pattern>
                   
<shadedPattern>org.apache.pulsar.shade.org.aopalliance</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>javassist</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.javassist</shadedPattern>
+                  <pattern>org.apache.bookkeeper</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.apache.bookkeeper</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>javax.inject</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.javax.inject</shadedPattern>
+                  <pattern>org.apache.commons</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.apache.commons</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.apache.pulsar.checksum</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.apache.pulsar.checksum</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.apache.pulsar.policies</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.apache.pulsar.policies</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.asynchttpclient</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.asynchttpclient</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.checkerframework</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.checkerframework</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.eclipse.jetty</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.eclipse.jetty</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.glassfish</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.glassfish</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.jvnet</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.jvnet</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.objenesis</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.objenesis</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>org.reactivestreams</pattern>
                   
<shadedPattern>org.apache.pulsar.shade.org.reactivestreams</shadedPattern>
                 </relocation>
-                  <relocation>
-                      <pattern>io.grpc</pattern>
-                      
<shadedPattern>org.apache.pulsar.shade.io.grpc</shadedPattern>
-                  </relocation>
-                  <relocation>
-                      <pattern>okio</pattern>
-                      
<shadedPattern>org.apache.pulsar.shade.okio</shadedPattern>
-                  </relocation>
-                  <relocation>
-                      <pattern>com.squareup</pattern>
-                      
<shadedPattern>org.apache.pulsar.shade.com.squareup</shadedPattern>
-                  </relocation>
-                  <relocation>
-                      <pattern>io.opencensus</pattern>
-                      
<shadedPattern>org.apache.pulsar.shade.io.opencensus</shadedPattern>
-                  </relocation>
-                  <relocation>
-                      <pattern>org.eclipse.jetty</pattern>
-                      
<shadedPattern>org.apache.pulsar.shade.org.eclipse.jetty</shadedPattern>
-                  </relocation>
-                  <relocation>
-                      <pattern>org.objenesis</pattern>
-                      
<shadedPattern>org.apache.pulsar.shade.org.objenesis</shadedPattern>
-                  </relocation>
-                  <relocation>
-                      <pattern>org.yaml</pattern>
-                      
<shadedPattern>org.apache.pulsar.shade.org.yaml</shadedPattern>
-                  </relocation>
-                  <relocation>
-                      <pattern>io.swagger</pattern>
-                      
<shadedPattern>org.apache.pulsar.shade.io.swagger</shadedPattern>
-                  </relocation>
-                  <relocation>
-                    <pattern>org.apache.bookkeeper</pattern>
-                    
<shadedPattern>org.apache.pulsar.shade.org.apache.bookkeeper</shadedPattern>
-                  </relocation>
-                  <!-- Rename Netty native libraries to include the shaded 
prefix -->
-                  <relocation>
-                    
<pattern>(META-INF/native/(lib)?)(netty.+\.(so|jnilib|dll))$</pattern>
-                    <shadedPattern>$1org_apache_pulsar_shade_$3</shadedPattern>
-                    <rawString>true</rawString>
-                  </relocation>
+                <relocation>
+                  <pattern>org.yaml</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.yaml</shadedPattern>
+                </relocation>
               </relocations>
               <transformers>
-                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"
 />
-                <transformer 
implementation="org.apache.maven.plugins.shade.resource.PluginXmlResourceTransformer"
 />
+                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+                <transformer 
implementation="org.apache.maven.plugins.shade.resource.PluginXmlResourceTransformer"/>
+                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                  <manifestEntries>
+                    <Multi-Release>true</Multi-Release>
+                  </manifestEntries>
+                </transformer>
               </transformers>
             </configuration>
           </execution>
diff --git 
a/pulsar-client-admin-shaded/src/main/resources/META-INF/services/org.apache.pulsar.shade.javax.ws.rs.client.ClientBuilder
 
b/pulsar-client-admin-shaded/src/main/resources/META-INF/services/org.apache.pulsar.shade.javax.ws.rs.client.ClientBuilder
new file mode 100644
index 00000000000..99a08cc8ca4
--- /dev/null
+++ 
b/pulsar-client-admin-shaded/src/main/resources/META-INF/services/org.apache.pulsar.shade.javax.ws.rs.client.ClientBuilder
@@ -0,0 +1 @@
+org.apache.pulsar.shade.org.glassfish.jersey.client.JerseyClientBuilder
\ No newline at end of file
diff --git 
a/pulsar-client-admin-shaded/src/main/resources/META-INF/services/org.apache.pulsar.shade.javax.ws.rs.ext.RuntimeDelegate
 
b/pulsar-client-admin-shaded/src/main/resources/META-INF/services/org.apache.pulsar.shade.javax.ws.rs.ext.RuntimeDelegate
new file mode 100644
index 00000000000..0adc919b7f0
--- /dev/null
+++ 
b/pulsar-client-admin-shaded/src/main/resources/META-INF/services/org.apache.pulsar.shade.javax.ws.rs.ext.RuntimeDelegate
@@ -0,0 +1 @@
+org.apache.pulsar.shade.org.glassfish.jersey.internal.RuntimeDelegateImpl
\ No newline at end of file
diff --git a/pulsar-client-admin/pom.xml b/pulsar-client-admin/pom.xml
index 36070618ed8..0a94e48e9b9 100644
--- a/pulsar-client-admin/pom.xml
+++ b/pulsar-client-admin/pom.xml
@@ -76,8 +76,8 @@
     </dependency>
 
     <dependency>
-      <groupId>javax.xml.bind</groupId>
-      <artifactId>jaxb-api</artifactId>
+      <groupId>jakarta.xml.bind</groupId>
+      <artifactId>jakarta.xml.bind-api</artifactId>
       <exclusions>
         <exclusion>
           <groupId>javax.activation</groupId>
diff --git a/pulsar-client-all/pom.xml b/pulsar-client-all/pom.xml
index e26f6eeac57..74007745c70 100644
--- a/pulsar-client-all/pom.xml
+++ b/pulsar-client-all/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" ?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -19,18 +20,15 @@
 
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   <modelVersion>4.0.0</modelVersion>
-
   <parent>
     <groupId>org.apache.pulsar</groupId>
     <artifactId>pulsar</artifactId>
     <version>4.1.0-SNAPSHOT</version>
   </parent>
-
   <artifactId>pulsar-client-all</artifactId>
   <name>Pulsar Client All</name>
-
   <dependencies>
     <dependency>
       <groupId>${project.groupId}</groupId>
@@ -69,7 +67,6 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
-
   <build>
     <plugins>
       <plugin>
@@ -107,7 +104,6 @@
           </execution>
         </executions>
       </plugin>
-
       <plugin>
         <artifactId>maven-antrun-plugin</artifactId>
         <executions>
@@ -120,15 +116,13 @@
             <configuration>
               <target>
                 <!-- shade the AsyncHttpClient ahc-default.properties files -->
-                <replace token= "org.asynchttpclient."
-                         value="org.apache.pulsar.shade.org.asynchttpclient."
-                         
file="${project.build.directory}/classes/org/asynchttpclient/config/ahc-default.properties"/>
+                <replace 
file="${project.build.directory}/classes/org/asynchttpclient/config/ahc-default.properties"
+                         token="org.asynchttpclient." 
value="org.apache.pulsar.shade.org.asynchttpclient."/>
               </target>
             </configuration>
           </execution>
         </executions>
       </plugin>
-
       <plugin>
         <!-- Shade all the dependencies to avoid conflicts -->
         <groupId>org.apache.maven.plugins</groupId>
@@ -145,67 +139,67 @@
               <createDependencyReducedPom>true</createDependencyReducedPom>
               
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
               <minimizeJar>false</minimizeJar>
-
               <artifactSet>
                 <includes>
-                  <include>org.apache.pulsar:pulsar-client-original</include>
-                  
<include>org.apache.pulsar:pulsar-client-admin-original</include>
-                  <include>org.apache.commons:commons-lang3</include>
-                  <include>commons-codec:commons-codec</include>
-                  <include>commons-collections:commons-collections</include>
-                  <include>org.asynchttpclient:*</include>
-                  <include>io.netty:netty-codec-http</include>
-                  <include>io.netty:netty-transport-native-epoll</include>
-                  <include>org.reactivestreams:reactive-streams</include>
-                  <include>com.typesafe.netty:netty-reactive-streams</include>
-                  <include>org.javassist:javassist</include>
-                  <include>com.google.guava:*</include>
-                  <include>org.checkerframework:*</include>
+                  <include>com.fasterxml.jackson.*:*</include>
+                  <include>com.google.*:*</include>
+                  <include>com.google.auth:*</include>
                   <include>com.google.code.findbugs:*</include>
+                  <include>com.google.code.gson:gson</include>
                   <include>com.google.errorprone:*</include>
+                  <include>com.google.guava:*</include>
                   <include>com.google.j2objc:*</include>
-                  <include>com.google.code.gson:gson</include>
                   <include>com.google.re2j:re2j</include>
                   <include>com.spotify:completable-futures</include>
-                  <include>com.fasterxml.jackson.*:*</include>
-                  <include>io.netty:netty</include>
-                  <include>io.netty:netty-all</include>
-                  <include>io.netty:netty-tcnative-boringssl-static</include>
-                  <include>org.eclipse.jetty:*</include>
+                  <include>com.squareup.*:*</include>
+                  <include>com.sun.activation:javax.activation</include>
+                  <!-- Avro transitive dependencies -->
+                  <include>com.thoughtworks.paranamer:paranamer</include>
+                  <include>com.typesafe.netty:netty-reactive-streams</include>
                   <include>com.yahoo.datasketches:*</include>
+                  <include>com.yahoo.datasketches:sketches-core</include>
                   <include>commons-*:*</include>
-                  <include>io.swagger:*</include>
+                  <include>commons-codec:commons-codec</include>
+                  <include>commons-collections:commons-collections</include>
                   <include>io.airlift:*</include>
-
-                  <include>org.apache.pulsar:pulsar-common</include>
-                  <include>org.apache.bookkeeper:*</include>
-                  <include>com.yahoo.datasketches:sketches-core</include>
-                  <include>org.glassfish.jersey*:*</include>
-                  <include>javax.ws.rs:*</include>
-                  <include>javax.xml.bind:jaxb-api</include>
-                  <include>jakarta.annotation:*</include>
-                  <include>org.glassfish.hk2*:*</include>
                   <include>io.grpc:*</include>
-                  <include>io.perfmark:*</include>
-                  <include>com.yahoo.datasketches:*</include>
-                  <include>io.netty:*</include>
                   <include>io.netty.incubator:*</include>
-                  <include>com.squareup.*:*</include>
-                  <include>com.google.*:*</include>
-                  <include>commons-*:*</include>
-                  <include>org.eclipse.jetty:*</include>
-                  <include>com.google.auth:*</include>
-                  <include>org.jvnet.mimepull:*</include>
+                  <include>io.netty:*</include>
+                  <include>io.netty:netty</include>
+                  <include>io.netty:netty-all</include>
+                  <include>io.netty:netty-codec-http</include>
+                  <include>io.netty:netty-tcnative-boringssl-static</include>
+                  <include>io.netty:netty-transport-native-epoll</include>
                   <include>io.opencensus:*</include>
-                  <include>org.objenesis:*</include>
-                  <include>org.yaml:snakeyaml</include>
+                  <include>io.perfmark:*</include>
+                  <include>io.swagger:*</include>
+                  <include>jakarta.activation:jakarta.activation-api</include>
+                  <include>jakarta.annotation:jakarta.annotation-api</include>
+                  <include>jakarta.ws.rs:jakarta.ws.rs-api</include>
+                  <include>jakarta.xml.bind:jakarta.xml.bind-api</include>
+                  <include>javax.ws.rs:*</include>
+                  <include>javax.xml.bind:jaxb-api</include>
+                  <include>net.jcip:jcip-annotations</include>
                   <include>org.apache.avro:*</include>
-                  <!-- Avro transitive dependencies-->
-                  <include>com.thoughtworks.paranamer:paranamer</include>
+                  <include>org.apache.bookkeeper:*</include>
                   <include>org.apache.commons:commons-compress</include>
-                  <include>org.tukaani:xz</include>
+                  <include>org.apache.commons:commons-lang3</include>
+                  
<include>org.apache.pulsar:pulsar-client-admin-original</include>
                   <!-- Issue #6834, Since Netty ByteBuf shaded, we need also 
shade this module -->
                   
<include>org.apache.pulsar:pulsar-client-messagecrypto-bc</include>
+                  <include>org.apache.pulsar:pulsar-client-original</include>
+                  <include>org.apache.pulsar:pulsar-common</include>
+                  <include>org.asynchttpclient:*</include>
+                  <include>org.checkerframework:*</include>
+                  <include>org.eclipse.jetty:*</include>
+                  <include>org.glassfish.hk2*:*</include>
+                  <include>org.glassfish.jersey*:*</include>
+                  <include>org.javassist:javassist</include>
+                  <include>org.jvnet.mimepull:*</include>
+                  <include>org.objenesis:*</include>
+                  <include>org.reactivestreams:reactive-streams</include>
+                  <include>org.tukaani:xz</include>
+                  <include>org.yaml:snakeyaml</include>
                 </includes>
                 <excludes>
                   
<exclude>com.fasterxml.jackson.core:jackson-annotations</exclude>
@@ -219,23 +213,54 @@
                     <include>**</include>
                   </includes>
                   <excludes>
-                    <!-- bouncycastle jars could not be shaded, or the 
signatures will be wrong-->
+                    <!-- bouncycastle jars could not be shaded, or the 
signatures will be wrong -->
                     <exclude>org/bouncycastle/**</exclude>
                   </excludes>
                 </filter>
+                <filter>
+                  <artifact>org.asynchttpclient:async-http-client</artifact>
+                  <includes>
+                    <include>**</include>
+                  </includes>
+                  <excludes>
+                    
<exclude>org/asynchttpclient/config/ahc-default.properties</exclude>
+                  </excludes>
+                </filter>
+                <filter>
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>**/module-info.class</exclude>
+                    <exclude>findbugsExclude.xml</exclude>
+                    <exclude>META-INF/*-LICENSE</exclude>
+                    <exclude>META-INF/*-NOTICE</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/DEPENDENCIES*</exclude>
+                    <exclude>META-INF/io.netty.versions.properties</exclude>
+                    <exclude>META-INF/LICENSE*</exclude>
+                    <exclude>META-INF/license/**</exclude>
+                    <exclude>META-INF/MANIFEST.MF</exclude>
+                    <exclude>META-INF/maven/**</exclude>
+                    <exclude>META-INF/native-image/**</exclude>
+                    <exclude>META-INF/NOTICE*</exclude>
+                    <exclude>META-INF/proguard/**</exclude>
+                  </excludes>
+                </filter>
               </filters>
               <relocations>
+                <!-- Rename Netty native libraries to include the shaded 
prefix -->
                 <relocation>
-                  <pattern>org.asynchttpclient</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.asynchttpclient</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>org.apache.bookkeeper</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.bookkeeper</shadedPattern>
+                  
<pattern>(META-INF/native/(lib)?)(netty.+\.(so|jnilib|dll))$</pattern>
+                  <shadedPattern>$1org_apache_pulsar_shade_$3</shadedPattern>
+                  <rawString>true</rawString>
                 </relocation>
                 <relocation>
-                  <pattern>org.apache.commons</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.commons</shadedPattern>
+                  <pattern>com.fasterxml.jackson</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.fasterxml.jackson</shadedPattern>
+                  <excludes>
+                    <exclude>com.fasterxml.jackson.annotation.*</exclude>
+                  </excludes>
                 </relocation>
                 <relocation>
                   <pattern>com.google</pattern>
@@ -249,103 +274,109 @@
                   
<shadedPattern>org.apache.pulsar.shade.com.spotify.futures</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>com.fasterxml.jackson</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.fasterxml.jackson</shadedPattern>
-                  <excludes>
-                    <exclude>com.fasterxml.jackson.annotation.*</exclude>
-                  </excludes>
+                  <pattern>com.squareup</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.squareup</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>io.netty</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.io.netty</shadedPattern>
+                  <pattern>com.sun.activation</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.sun.activation</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.apache.pulsar.policies</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.pulsar.policies</shadedPattern>
+                  <pattern>com.thoughtworks.paranamer</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.thoughtworks.paranamer</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>com.yahoo.datasketches</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.yahoo.datasketches</shadedPattern>
+                  <pattern>com.typesafe</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.typesafe</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>com.yahoo</pattern>
                   
<shadedPattern>org.apache.pulsar.shade.com.yahoo</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.eclipse.jetty</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.eclipse</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>org.reactivestreams</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.reactivestreams</shadedPattern>
+                  <pattern>com.yahoo.datasketches</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.yahoo.datasketches</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>com.typesafe</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.typesafe</shadedPattern>
+                  <pattern>io.airlift</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.io.airlift</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>javax.ws</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.javax.ws</shadedPattern>
+                  <pattern>io.grpc</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.io.grpc</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>javax.annotation</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.javax.annotation</shadedPattern>
+                  <pattern>io.netty</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.io.netty</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>javax.xml.bind</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.javax.xml.bind</shadedPattern>
+                  <pattern>io.opencensus</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.io.opencensus</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>jersey</pattern>
-                  <shadedPattern>org.apache.pulsar.shade.jersey</shadedPattern>
+                  <pattern>io.swagger</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.io.swagger</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.jvnet</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.jvnet</shadedPattern>
+                  <pattern>javassist</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.javassist</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.aopalliance</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.aopalliance</shadedPattern>
+                  <pattern>javax.activation</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.javax.activation</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>javassist</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.javassist</shadedPattern>
+                  <pattern>javax.annotation</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.javax.annotation</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>javax.inject</pattern>
                   
<shadedPattern>org.apache.pulsar.shade.javax.inject</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.glassfish</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.glassfish</shadedPattern>
+                  <pattern>javax.ws</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.javax.ws</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.xml.bind</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.javax.xml.bind</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>jersey</pattern>
+                  <shadedPattern>org.apache.pulsar.shade.jersey</shadedPattern>
                 </relocation>
                 <relocation>
-                    <pattern>io.grpc</pattern>
-                    
<shadedPattern>org.apache.pulsar.shade.io.grpc</shadedPattern>
+                  
<pattern>META-INF/versions/(\d+)/com/fasterxml/jackson/core/</pattern>
+                  
<shadedPattern>META-INF/versions/$1/org/apache/pulsar/shade/com/fasterxml/jackson/core/
+                  </shadedPattern>
+                  <rawString>true</rawString>
                 </relocation>
                 <relocation>
-                    <pattern>okio</pattern>
-                    <shadedPattern>org.apache.pulsar.shade.okio</shadedPattern>
+                  <pattern>META-INF/versions/(\d+)/javax/xml/bind/</pattern>
+                  
<shadedPattern>META-INF/versions/$1/org/apache/pulsar/shade/javax/xml/bind/</shadedPattern>
+                  <rawString>true</rawString>
                 </relocation>
                 <relocation>
-                    <pattern>com.squareup</pattern>
-                    
<shadedPattern>org.apache.pulsar.shade.com.squareup</shadedPattern>
+                  <pattern>META-INF/versions/(\d+)/org/glassfish/</pattern>
+                  
<shadedPattern>META-INF/versions/$1/org/apache/pulsar/shade/org/glassfish/</shadedPattern>
+                  <rawString>true</rawString>
                 </relocation>
                 <relocation>
-                    <pattern>io.opencensus</pattern>
-                    
<shadedPattern>org.apache.pulsar.shade.io.opencensus</shadedPattern>
+                  <pattern>META-INF/versions/(\d+)/org/yaml/</pattern>
+                  
<shadedPattern>META-INF/versions/$1/org/apache/pulsar/shade/org/yaml/</shadedPattern>
+                  <rawString>true</rawString>
                 </relocation>
                 <relocation>
-                    <pattern>org.eclipse.jetty</pattern>
-                    
<shadedPattern>org.apache.pulsar.shade.org.eclipse.jetty</shadedPattern>
+                  <pattern>net.jcip</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.net.jcip</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.objenesis</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.objenesis</shadedPattern>
+                  <pattern>okio</pattern>
+                  <shadedPattern>org.apache.pulsar.shade.okio</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.yaml</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.yaml</shadedPattern>
+                  <pattern>org.aopalliance</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.aopalliance</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>org.apache.avro</pattern>
@@ -363,45 +394,68 @@
                     <exclude>org.apache.avro.reflect.Union</exclude>
                   </excludes>
                 </relocation>
-                <!--Avro transitive dependencies-->
-                <relocation>
-                  <pattern>org.codehaus.jackson</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.codehaus.jackson</shadedPattern>
-                </relocation>
                 <relocation>
-                  <pattern>com.thoughtworks.paranamer</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.thoughtworks.paranamer</shadedPattern>
+                  <pattern>org.apache.bookkeeper</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.apache.bookkeeper</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>org.apache.commons</pattern>
                   
<shadedPattern>org.apache.pulsar.shade.org.apache.commons</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>io.airlift</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.io.airlift</shadedPattern>
+                  <pattern>org.apache.pulsar.policies</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.apache.pulsar.policies</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.asynchttpclient</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.asynchttpclient</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>org.checkerframework</pattern>
                   
<shadedPattern>org.apache.pulsar.shade.org.checkerframework</shadedPattern>
                 </relocation>
+                <!-- Avro transitive dependencies -->
                 <relocation>
-                  <pattern>javax.annotation</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.javax.annotation</shadedPattern>
+                  <pattern>org.codehaus.jackson</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.codehaus.jackson</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.eclipse.jetty</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.eclipse</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.glassfish</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.glassfish</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.jvnet</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.jvnet</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.objenesis</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.objenesis</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.reactivestreams</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.reactivestreams</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>org.tukaani</pattern>
                   
<shadedPattern>org.apache.pulsar.shade.org.tukaani</shadedPattern>
                 </relocation>
-                <!-- Rename Netty native libraries to include the shaded 
prefix -->
                 <relocation>
-                  
<pattern>(META-INF/native/(lib)?)(netty.+\.(so|jnilib|dll))$</pattern>
-                  <shadedPattern>$1org_apache_pulsar_shade_$3</shadedPattern>
-                  <rawString>true</rawString>
+                  <pattern>org.yaml</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.yaml</shadedPattern>
                 </relocation>
               </relocations>
               <transformers>
-                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"
 />
-                <transformer 
implementation="org.apache.maven.plugins.shade.resource.PluginXmlResourceTransformer"
 />
+                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+                <transformer 
implementation="org.apache.maven.plugins.shade.resource.PluginXmlResourceTransformer"/>
+                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                  <manifestEntries>
+                    <Multi-Release>true</Multi-Release>
+                  </manifestEntries>
+                </transformer>
               </transformers>
             </configuration>
           </execution>
diff --git 
a/pulsar-client-all/src/main/resources/META-INF/services/org.apache.pulsar.shade.javax.ws.rs.client.ClientBuilder
 
b/pulsar-client-all/src/main/resources/META-INF/services/org.apache.pulsar.shade.javax.ws.rs.client.ClientBuilder
new file mode 100644
index 00000000000..99a08cc8ca4
--- /dev/null
+++ 
b/pulsar-client-all/src/main/resources/META-INF/services/org.apache.pulsar.shade.javax.ws.rs.client.ClientBuilder
@@ -0,0 +1 @@
+org.apache.pulsar.shade.org.glassfish.jersey.client.JerseyClientBuilder
\ No newline at end of file
diff --git 
a/pulsar-client-all/src/main/resources/META-INF/services/org.apache.pulsar.shade.javax.ws.rs.ext.RuntimeDelegate
 
b/pulsar-client-all/src/main/resources/META-INF/services/org.apache.pulsar.shade.javax.ws.rs.ext.RuntimeDelegate
new file mode 100644
index 00000000000..0adc919b7f0
--- /dev/null
+++ 
b/pulsar-client-all/src/main/resources/META-INF/services/org.apache.pulsar.shade.javax.ws.rs.ext.RuntimeDelegate
@@ -0,0 +1 @@
+org.apache.pulsar.shade.org.glassfish.jersey.internal.RuntimeDelegateImpl
\ No newline at end of file
diff --git a/pulsar-client-auth-athenz/pom.xml 
b/pulsar-client-auth-athenz/pom.xml
index 99786b4d18d..0e994ce25c2 100644
--- a/pulsar-client-auth-athenz/pom.xml
+++ b/pulsar-client-auth-athenz/pom.xml
@@ -46,6 +46,11 @@
       <artifactId>athenz-zts-java-client-core</artifactId>
     </dependency>
 
+    <dependency>
+      <groupId>jakarta.ws.rs</groupId>
+      <artifactId>jakarta.ws.rs-api</artifactId>
+    </dependency>
+
     <dependency>
       <groupId>com.yahoo.athenz</groupId>
       <artifactId>athenz-cert-refresher</artifactId>
diff --git a/pulsar-client-auth-sasl/pom.xml b/pulsar-client-auth-sasl/pom.xml
index 1a4720b3d58..61d1157afda 100644
--- a/pulsar-client-auth-sasl/pom.xml
+++ b/pulsar-client-auth-sasl/pom.xml
@@ -57,8 +57,8 @@
     </dependency>
 
     <dependency>
-      <groupId>javax.ws.rs</groupId>
-      <artifactId>javax.ws.rs-api</artifactId>
+      <groupId>jakarta.ws.rs</groupId>
+      <artifactId>jakarta.ws.rs-api</artifactId>
     </dependency>
 
     <dependency>
diff --git a/pulsar-client-shaded/pom.xml b/pulsar-client-shaded/pom.xml
index cd87d901b21..1093b405731 100644
--- a/pulsar-client-shaded/pom.xml
+++ b/pulsar-client-shaded/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" ?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -19,18 +20,15 @@
 
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   <modelVersion>4.0.0</modelVersion>
-
   <parent>
     <groupId>org.apache.pulsar</groupId>
     <artifactId>pulsar</artifactId>
     <version>4.1.0-SNAPSHOT</version>
   </parent>
-
   <artifactId>pulsar-client</artifactId>
   <name>Pulsar Client Java</name>
-
   <dependencies>
     <dependency>
       <groupId>${project.groupId}</groupId>
@@ -48,11 +46,8 @@
       <version>${project.version}</version>
     </dependency>
   </dependencies>
-
   <build>
     <plugins>
-
-
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-dependency-plugin</artifactId>
@@ -88,7 +83,6 @@
           </execution>
         </executions>
       </plugin>
-
       <plugin>
         <artifactId>maven-antrun-plugin</artifactId>
         <executions>
@@ -101,15 +95,13 @@
             <configuration>
               <target>
                 <!-- shade the AsyncHttpClient ahc-default.properties files -->
-                <replace token= "org.asynchttpclient."
-                         value="org.apache.pulsar.shade.org.asynchttpclient."
-                         
file="${project.build.directory}/classes/org/asynchttpclient/config/ahc-default.properties"/>
+                <replace 
file="${project.build.directory}/classes/org/asynchttpclient/config/ahc-default.properties"
+                         token="org.asynchttpclient." 
value="org.apache.pulsar.shade.org.asynchttpclient."/>
               </target>
             </configuration>
           </execution>
         </executions>
       </plugin>
-
       <plugin>
         <!-- Shade all the dependencies to avoid conflicts -->
         <groupId>org.apache.maven.plugins</groupId>
@@ -124,50 +116,54 @@
               <createDependencyReducedPom>true</createDependencyReducedPom>
               
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
               <minimizeJar>false</minimizeJar>
-
               <artifactSet>
                 <includes>
-                  <include>org.apache.pulsar:pulsar-client-original</include>
-                  <include>org.apache.bookkeeper:*</include>
-                  <include>org.apache.commons:commons-lang3</include>
-                  <include>commons-codec:commons-codec</include>
-                  <include>commons-collections:commons-collections</include>
-                  <include>org.asynchttpclient:*</include>
-                  <include>io.netty:netty-codec-http</include>
-                  <include>io.netty:netty-transport-native-epoll</include>
-                  <include>org.reactivestreams:reactive-streams</include>
-                  <include>com.typesafe.netty:netty-reactive-streams</include>
-                  <include>org.javassist:javassist</include>
-                  <include>com.google.guava:*</include>
-                  <include>org.checkerframework:*</include>
+                  <include>com.fasterxml.jackson.*:*</include>
                   <include>com.google.code.findbugs:*</include>
+                  <include>com.google.code.gson:gson</include>
                   <include>com.google.errorprone:*</include>
+                  <include>com.google.guava:*</include>
                   <include>com.google.j2objc:*</include>
-                  <include>com.google.code.gson:gson</include>
                   <include>com.google.re2j:re2j</include>
                   <include>com.spotify:completable-futures</include>
-                  <include>com.fasterxml.jackson.*:*</include>
-                  <include>io.netty:*</include>
-                  <include>io.netty.incubator:*</include>
-                  <include>io.perfmark:*</include>
-                  <include>org.eclipse.jetty:*</include>
+                  <include>com.sun.activation:javax.activation</include>
+                  <!-- Avro transitive dependencies -->
+                  <include>com.thoughtworks.paranamer:paranamer</include>
+                  <include>com.typesafe.netty:netty-reactive-streams</include>
                   <include>com.yahoo.datasketches:*</include>
+                  <include>com.yahoo.datasketches:sketches-core</include>
                   <include>commons-*:*</include>
-                  <include>io.swagger:*</include>
+                  <include>commons-codec:commons-codec</include>
+                  <include>commons-collections:commons-collections</include>
                   <include>io.airlift:*</include>
-
-                  <include>org.apache.pulsar:pulsar-common</include>
-                  <include>com.yahoo.datasketches:sketches-core</include>
-                  <include>org.objenesis:*</include>
-                  <include>org.yaml:snakeyaml</include>
-
+                  <include>io.netty.incubator:*</include>
+                  <include>io.netty:*</include>
+                  <include>io.netty:netty-codec-http</include>
+                  <include>io.netty:netty-transport-native-epoll</include>
+                  <include>io.perfmark:*</include>
+                  <include>io.swagger:*</include>
+                  <include>jakarta.activation:jakarta.activation-api</include>
+                  <include>jakarta.annotation:jakarta.annotation-api</include>
+                  <include>jakarta.ws.rs:jakarta.ws.rs-api</include>
+                  <include>jakarta.xml.bind:jakarta.xml.bind-api</include>
+                  <include>javax.ws.rs:*</include>
+                  <include>net.jcip:jcip-annotations</include>
                   <include>org.apache.avro:*</include>
-                  <!-- Avro transitive dependencies-->
-                  <include>com.thoughtworks.paranamer:paranamer</include>
+                  <include>org.apache.bookkeeper:*</include>
                   <include>org.apache.commons:commons-compress</include>
-                  <include>org.tukaani:xz</include>
+                  <include>org.apache.commons:commons-lang3</include>
                   <!-- Issue #6834, Since Netty ByteBuf shaded, we need also 
shade this module -->
                   
<include>org.apache.pulsar:pulsar-client-messagecrypto-bc</include>
+                  <include>org.apache.pulsar:pulsar-client-original</include>
+                  <include>org.apache.pulsar:pulsar-common</include>
+                  <include>org.asynchttpclient:*</include>
+                  <include>org.checkerframework:*</include>
+                  <include>org.eclipse.jetty:*</include>
+                  <include>org.javassist:javassist</include>
+                  <include>org.objenesis:*</include>
+                  <include>org.reactivestreams:reactive-streams</include>
+                  <include>org.tukaani:xz</include>
+                  <include>org.yaml:snakeyaml</include>
                 </includes>
                 <excludes>
                   
<exclude>com.fasterxml.jackson.core:jackson-annotations</exclude>
@@ -180,23 +176,45 @@
                     <include>**</include>
                   </includes>
                   <excludes>
-                    <!-- bouncycastle jars could not be shaded, or the 
signatures will be wrong-->
+                    <!-- bouncycastle jars could not be shaded, or the 
signatures will be wrong -->
                     <exclude>org/bouncycastle/**</exclude>
                   </excludes>
                 </filter>
+                <filter>
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>**/module-info.class</exclude>
+                    <exclude>findbugsExclude.xml</exclude>
+                    <exclude>META-INF/*-LICENSE</exclude>
+                    <exclude>META-INF/*-NOTICE</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/DEPENDENCIES*</exclude>
+                    <exclude>META-INF/io.netty.versions.properties</exclude>
+                    <exclude>META-INF/LICENSE*</exclude>
+                    <exclude>META-INF/license/**</exclude>
+                    <exclude>META-INF/MANIFEST.MF</exclude>
+                    <exclude>META-INF/maven/**</exclude>
+                    <exclude>META-INF/native-image/**</exclude>
+                    <exclude>META-INF/NOTICE*</exclude>
+                    <exclude>META-INF/proguard/**</exclude>
+                  </excludes>
+                </filter>
               </filters>
               <relocations>
+                <!-- Rename Netty native libraries to include the shaded 
prefix -->
                 <relocation>
-                  <pattern>org.asynchttpclient</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.asynchttpclient</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>org.apache.commons</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.commons</shadedPattern>
+                  
<pattern>(META-INF/native/(lib)?)(netty.+\.(so|jnilib|dll))$</pattern>
+                  <shadedPattern>$1org_apache_pulsar_shade_$3</shadedPattern>
+                  <rawString>true</rawString>
                 </relocation>
                 <relocation>
-                  <pattern>io.airlift</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.io.airlift</shadedPattern>
+                  <pattern>com.fasterxml.jackson</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.fasterxml.jackson</shadedPattern>
+                  <excludes>
+                    <exclude>com.fasterxml.jackson.annotation.*</exclude>
+                  </excludes>
                 </relocation>
                 <relocation>
                   <pattern>com.google</pattern>
@@ -210,63 +228,67 @@
                   
<shadedPattern>org.apache.pulsar.shade.com.spotify.futures</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>com.fasterxml.jackson</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.fasterxml.jackson</shadedPattern>
-                  <excludes>
-                    <exclude>com.fasterxml.jackson.annotation.*</exclude>
-                  </excludes>
+                  <pattern>com.sun.activation</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.sun.activation</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>io.netty</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.io.netty</shadedPattern>
+                  <pattern>com.thoughtworks.paranamer</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.thoughtworks.paranamer</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.checkerframework</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.checkerframework</shadedPattern>
+                  <pattern>com.typesafe</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.typesafe</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>javax.annotation</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.javax.annotation</shadedPattern>
+                  <pattern>com.yahoo.datasketches</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.yahoo.datasketches</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>io.swagger</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.io.swagger</shadedPattern>
+                  <pattern>com.yahoo.memory</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.yahoo.memory</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.apache.pulsar.policies</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.pulsar.policies</shadedPattern>
+                  <pattern>com.yahoo.sketches</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.com.yahoo.sketches</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>com.yahoo.datasketches</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.yahoo.datasketches</shadedPattern>
+                  <pattern>io.airlift</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.io.airlift</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>com.yahoo.sketches</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.yahoo.sketches</shadedPattern>
+                  <pattern>io.netty</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.io.netty</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.eclipse.jetty</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.eclipse</shadedPattern>
+                  <pattern>io.swagger</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.io.swagger</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.reactivestreams</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.reactivestreams</shadedPattern>
+                  <pattern>javax.activation</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.javax.activation</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>com.typesafe</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.typesafe</shadedPattern>
+                  <pattern>javax.annotation</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.javax.annotation</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>com.yahoo.memory</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.yahoo.memory</shadedPattern>
+                  <pattern>javax.ws</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.javax.ws</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.objenesis</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.objenesis</shadedPattern>
+                  
<pattern>META-INF/versions/(\d+)/com/fasterxml/jackson/core/</pattern>
+                  
<shadedPattern>META-INF/versions/$1/org/apache/pulsar/shade/com/fasterxml/jackson/core/
+                  </shadedPattern>
+                  <rawString>true</rawString>
                 </relocation>
                 <relocation>
-                  <pattern>org.yaml</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.yaml</shadedPattern>
+                  <pattern>META-INF/versions/(\d+)/org/yaml/</pattern>
+                  
<shadedPattern>META-INF/versions/$1/org/apache/pulsar/shade/org/yaml/</shadedPattern>
+                  <rawString>true</rawString>
+                </relocation>
+                <relocation>
+                  <pattern>net.jcip</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.net.jcip</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>org.apache.avro</pattern>
@@ -284,43 +306,65 @@
                     <exclude>org.apache.avro.reflect.Union</exclude>
                   </excludes>
                 </relocation>
-                <!--Avro transitive dependencies-->
+                <relocation>
+                  <pattern>org.apache.bookkeeper</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.apache.bookkeeper</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.apache.commons</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.apache.commons</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.apache.pulsar.policies</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.apache.pulsar.policies</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.asynchttpclient</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.asynchttpclient</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.checkerframework</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.checkerframework</shadedPattern>
+                </relocation>
+                <!-- Avro transitive dependencies -->
                 <relocation>
                   <pattern>org.codehaus.jackson</pattern>
                   
<shadedPattern>org.apache.pulsar.shade.org.codehaus.jackson</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>com.thoughtworks.paranamer</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.thoughtworks.paranamer</shadedPattern>
+                  <pattern>org.eclipse.jetty</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.eclipse</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.apache.commons</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.commons</shadedPattern>
+                  <pattern>org.objenesis</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.objenesis</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.tukaani</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.tukaani</shadedPattern>
+                  <pattern>org.reactivestreams</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.reactivestreams</shadedPattern>
                 </relocation>
                 <relocation>
-                  <pattern>org.apache.bookkeeper</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.bookkeeper</shadedPattern>
+                  <pattern>org.tukaani</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.tukaani</shadedPattern>
                 </relocation>
-                <!-- Rename Netty native libraries to include the shaded 
prefix -->
                 <relocation>
-                  
<pattern>(META-INF/native/(lib)?)(netty.+\.(so|jnilib|dll))$</pattern>
-                  <shadedPattern>$1org_apache_pulsar_shade_$3</shadedPattern>
-                  <rawString>true</rawString>
+                  <pattern>org.yaml</pattern>
+                  
<shadedPattern>org.apache.pulsar.shade.org.yaml</shadedPattern>
                 </relocation>
               </relocations>
               <transformers>
-                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"
 />
-                <transformer 
implementation="org.apache.maven.plugins.shade.resource.PluginXmlResourceTransformer"
 />
+                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+                <transformer 
implementation="org.apache.maven.plugins.shade.resource.PluginXmlResourceTransformer"/>
+                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                  <manifestEntries>
+                    <Multi-Release>true</Multi-Release>
+                  </manifestEntries>
+                </transformer>
               </transformers>
             </configuration>
           </execution>
         </executions>
       </plugin>
-
       <plugin>
         <groupId>com.github.spotbugs</groupId>
         <artifactId>spotbugs-maven-plugin</artifactId>
diff --git a/pulsar-common/pom.xml b/pulsar-common/pom.xml
index 241dd173ea9..c823b8408c9 100644
--- a/pulsar-common/pom.xml
+++ b/pulsar-common/pom.xml
@@ -184,8 +184,8 @@
     </dependency>
 
     <dependency>
-      <groupId>javax.ws.rs</groupId>
-      <artifactId>javax.ws.rs-api</artifactId>
+      <groupId>jakarta.ws.rs</groupId>
+      <artifactId>jakarta.ws.rs-api</artifactId>
     </dependency>
 
     <dependency>
diff --git a/pulsar-functions/proto/pom.xml b/pulsar-functions/proto/pom.xml
index db87ff7ef20..e9e9678d1b9 100644
--- a/pulsar-functions/proto/pom.xml
+++ b/pulsar-functions/proto/pom.xml
@@ -44,10 +44,10 @@
             <groupId>com.google.protobuf</groupId>
             <artifactId>protobuf-java-util</artifactId>
         </dependency>
-        
+
         <dependency>
-          <groupId>javax.annotation</groupId>
-          <artifactId>javax.annotation-api</artifactId>
+          <groupId>jakarta.annotation</groupId>
+          <artifactId>jakarta.annotation-api</artifactId>
         </dependency>
 
         <dependency>
diff --git a/pulsar-functions/runtime/pom.xml b/pulsar-functions/runtime/pom.xml
index b04d25a5af0..b2df8f224bc 100644
--- a/pulsar-functions/runtime/pom.xml
+++ b/pulsar-functions/runtime/pom.xml
@@ -77,6 +77,10 @@
           <artifactId>bcprov-jdk18on</artifactId>
           <groupId>org.bouncycastle</groupId>
         </exclusion>
+        <exclusion>
+          <groupId>javax.annotation</groupId>
+          <artifactId>javax.annotation-api</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
     <dependency>
@@ -106,7 +110,7 @@
           </execution>
         </executions>
       </plugin>
-      
+
       <!-- this task will copy config files to resources for the test to work 
-->
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
diff --git a/pulsar-functions/secrets/pom.xml b/pulsar-functions/secrets/pom.xml
index c7ab69ec612..ac7d89a0a0c 100644
--- a/pulsar-functions/secrets/pom.xml
+++ b/pulsar-functions/secrets/pom.xml
@@ -48,6 +48,10 @@
           <artifactId>bcprov-jdk18on</artifactId>
           <groupId>org.bouncycastle</groupId>
         </exclusion>
+        <exclusion>
+          <groupId>javax.annotation</groupId>
+          <artifactId>javax.annotation-api</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
 
@@ -76,7 +80,7 @@
           </execution>
         </executions>
       </plugin>
-      
+
       <plugin>
         <groupId>com.github.spotbugs</groupId>
         <artifactId>spotbugs-maven-plugin</artifactId>
diff --git a/pulsar-proxy/pom.xml b/pulsar-proxy/pom.xml
index 73ed347d24f..2cea6e08930 100644
--- a/pulsar-proxy/pom.xml
+++ b/pulsar-proxy/pom.xml
@@ -134,8 +134,8 @@
     </dependency>
 
     <dependency>
-      <groupId>javax.xml.bind</groupId>
-      <artifactId>jaxb-api</artifactId>
+      <groupId>jakarta.xml.bind</groupId>
+      <artifactId>jakarta.xml.bind-api</artifactId>
     </dependency>
 
     <dependency>
diff --git a/tiered-storage/jcloud/pom.xml b/tiered-storage/jcloud/pom.xml
index 366ba9ae38c..8fa504227fe 100644
--- a/tiered-storage/jcloud/pom.xml
+++ b/tiered-storage/jcloud/pom.xml
@@ -104,8 +104,8 @@
     </dependency>
 
     <dependency>
-      <groupId>javax.xml.bind</groupId>
-      <artifactId>jaxb-api</artifactId>
+      <groupId>jakarta.xml.bind</groupId>
+      <artifactId>jakarta.xml.bind-api</artifactId>
       <exclusions>
         <exclusion>
           <groupId>javax.activation</groupId>

Reply via email to