You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/12/31 13:49:14 UTC

[shardingsphere] branch master updated: Refactor agent shade plugin usage (#23203)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new fd87956909e Refactor agent shade plugin usage (#23203)
fd87956909e is described below

commit fd87956909ee4bb0d03008600e3c2f3720cb2353
Author: 孙念君 Nianjun Sun <su...@apache.org>
AuthorDate: Sat Dec 31 21:49:08 2022 +0800

    Refactor agent shade plugin usage (#23203)
    
    * Refactor : change the zipkin packging usage (#23178)
    
    * Refactor : refactor the maven shade plugin structure in agent module (#23178)
    
    * Fix : fix an incorrect path of target (#23178)
---
 .../shardingsphere-agent-binary-distribution.xml   | 11 ++-
 agent/plugins/logging/base/pom.xml                 | 43 ++++++++++++
 agent/plugins/logging/pom.xml                      | 15 ----
 agent/plugins/metrics/core/pom.xml                 | 34 +++++++++-
 agent/plugins/metrics/type/pom.xml                 | 15 ----
 agent/plugins/metrics/type/prometheus/pom.xml      | 53 +++++++++++++++
 agent/plugins/pom.xml                              | 66 ------------------
 agent/plugins/tracing/pom.xml                      | 13 ----
 agent/plugins/tracing/type/jaeger/pom.xml          | 75 ++++++++++++++++++++
 agent/plugins/tracing/type/opentelemetry/pom.xml   | 79 ++++++++++++++++++++++
 agent/plugins/tracing/type/opentracing/pom.xml     | 51 ++++++++++++++
 agent/plugins/tracing/type/pom.xml                 | 13 +---
 agent/plugins/tracing/type/zipkin/pom.xml          | 59 ++++++++++++++++
 ...ngsphere-proxy-agent-opentelemetry-assembly.xml |  2 +-
 14 files changed, 399 insertions(+), 130 deletions(-)

diff --git a/agent/distribution/src/main/assembly/shardingsphere-agent-binary-distribution.xml b/agent/distribution/src/main/assembly/shardingsphere-agent-binary-distribution.xml
index d38991331cb..4a298cc721b 100644
--- a/agent/distribution/src/main/assembly/shardingsphere-agent-binary-distribution.xml
+++ b/agent/distribution/src/main/assembly/shardingsphere-agent-binary-distribution.xml
@@ -40,7 +40,7 @@
         </fileSet>
         
         <fileSet>
-            <directory>../plugins/logging/target/plugins</directory>
+            <directory>../plugins/logging/base/target/plugins</directory>
             <outputDirectory>./plugins</outputDirectory>
             <includes>
                 <include>**.jar</include>
@@ -48,17 +48,14 @@
         </fileSet>
         
         <fileSet>
-            <directory>../plugins/tracing/target/plugins</directory>
+            <directory>../plugins/tracing/type/target/plugins</directory>
             <outputDirectory>./plugins</outputDirectory>
             <includes>
                 <include>**.jar</include>
             </includes>
-            <excludes>
-                <exclude>shardingsphere-agent-tracing-test-${project.version}.jar</exclude>
-            </excludes>
         </fileSet>
         <fileSet>
-            <directory>../plugins/metrics/target/plugins</directory>
+            <directory>../plugins/metrics/type/target/plugins</directory>
             <outputDirectory>./plugins</outputDirectory>
             <includes>
                 <include>**.jar</include>
@@ -72,7 +69,7 @@
             </includes>
         </fileSet>
         <fileSet>
-            <directory>../plugins/metrics/target/lib</directory>
+            <directory>../plugins/metrics/core/target/lib</directory>
             <outputDirectory>./lib</outputDirectory>
             <includes>
                 <include>**.jar</include>
diff --git a/agent/plugins/logging/base/pom.xml b/agent/plugins/logging/base/pom.xml
index cfbad00fd4c..720404746a9 100644
--- a/agent/plugins/logging/base/pom.xml
+++ b/agent/plugins/logging/base/pom.xml
@@ -26,4 +26,47 @@
     </parent>
     <artifactId>shardingsphere-agent-logging-base</artifactId>
     <name>${project.artifactId}</name>
+    
+    <properties>
+        <target.directory>${project.basedir}/target/plugins</target.directory>
+    </properties>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-shade-plugin</artifactId>
+                <configuration>
+                    <minimizeJar>true</minimizeJar>
+                    <createDependencyReducedPom>false</createDependencyReducedPom>
+                    <outputFile>${target.directory}/${project.build.finalName}.jar</outputFile>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <relocations>
+                                <relocation>
+                                    <pattern>org.slf4j</pattern>
+                                    <shadedPattern>${shade.package}.org.slf4j</shadedPattern>
+                                </relocation>
+                            </relocations>
+                            <filters>
+                                <filter>
+                                    <artifact>*:*</artifact>
+                                    <excludes>
+                                        <exclude>META-INF/*.SF</exclude>
+                                        <exclude>META-INF/*.DSA</exclude>
+                                        <exclude>META-INF/*.RSA</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/agent/plugins/logging/pom.xml b/agent/plugins/logging/pom.xml
index 487e071ff7b..1d1533c4a2b 100644
--- a/agent/plugins/logging/pom.xml
+++ b/agent/plugins/logging/pom.xml
@@ -32,10 +32,6 @@
         <module>base</module>
     </modules>
     
-    <properties>
-        <target.directory>${project.basedir}/../target/plugins</target.directory>
-    </properties>
-    
     <dependencies>
         <dependency>
             <groupId>org.apache.shardingsphere</groupId>
@@ -44,15 +40,4 @@
             <scope>provided</scope>
         </dependency>
     </dependencies>
-    
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-shade-plugin</artifactId>
-                <configuration>
-                    <outputFile>${target.directory}/${project.build.finalName}.jar</outputFile>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
 </project>
diff --git a/agent/plugins/metrics/core/pom.xml b/agent/plugins/metrics/core/pom.xml
index b4ec8969a2f..9192f1d36a6 100644
--- a/agent/plugins/metrics/core/pom.xml
+++ b/agent/plugins/metrics/core/pom.xml
@@ -28,7 +28,7 @@
     <name>${project.artifactId}</name>
     
     <properties>
-        <target.directory>${project.basedir}/../target/lib</target.directory>
+        <target.directory>${project.basedir}/target/lib</target.directory>
     </properties>
     
     <dependencies>
@@ -57,8 +57,40 @@
             <plugin>
                 <artifactId>maven-shade-plugin</artifactId>
                 <configuration>
+                    <minimizeJar>true</minimizeJar>
+                    <createDependencyReducedPom>false</createDependencyReducedPom>
                     <outputFile>${target.directory}/${project.build.finalName}.jar</outputFile>
                 </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <relocations>
+                                <relocation>
+                                    <pattern>com.google.common</pattern>
+                                    <shadedPattern>${shade.package}.com.google.common</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>net.bytebuddy</pattern>
+                                    <shadedPattern>${shade.package}.net.bytebuddy</shadedPattern>
+                                </relocation>
+                            </relocations>
+                            <filters>
+                                <filter>
+                                    <artifact>*:*</artifact>
+                                    <excludes>
+                                        <exclude>META-INF/*.SF</exclude>
+                                        <exclude>META-INF/*.DSA</exclude>
+                                        <exclude>META-INF/*.RSA</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                        </configuration>
+                    </execution>
+                </executions>
             </plugin>
         </plugins>
     </build>
diff --git a/agent/plugins/metrics/type/pom.xml b/agent/plugins/metrics/type/pom.xml
index 2a10e6299dc..a65de84a1e5 100644
--- a/agent/plugins/metrics/type/pom.xml
+++ b/agent/plugins/metrics/type/pom.xml
@@ -31,19 +31,4 @@
     <modules>
         <module>prometheus</module>
     </modules>
-    
-    <properties>
-        <target.directory>${project.basedir}/../../target/plugins</target.directory>
-    </properties>
-    
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-shade-plugin</artifactId>
-                <configuration>
-                    <outputFile>${target.directory}/${project.build.finalName}.jar</outputFile>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
 </project>
diff --git a/agent/plugins/metrics/type/prometheus/pom.xml b/agent/plugins/metrics/type/prometheus/pom.xml
index 5ff53433bd8..72acfc59945 100644
--- a/agent/plugins/metrics/type/prometheus/pom.xml
+++ b/agent/plugins/metrics/type/prometheus/pom.xml
@@ -28,6 +28,7 @@
     <name>${project.artifactId}</name>
     
     <properties>
+        <target.directory>${project.basedir}/../target/plugins</target.directory>
         <prometheus.version>0.11.0</prometheus.version>
         <prometheus.jmx.version>0.16.1</prometheus.jmx.version>
     </properties>
@@ -91,8 +92,60 @@
             <plugin>
                 <artifactId>maven-shade-plugin</artifactId>
                 <configuration>
+                    <minimizeJar>true</minimizeJar>
+                    <createDependencyReducedPom>false</createDependencyReducedPom>
                     <outputFile>${target.directory}/${project.build.finalName}.jar</outputFile>
                 </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <relocations>
+                                <relocation>
+                                    <pattern>com.google.common</pattern>
+                                    <shadedPattern>${shade.package}.com.google.common</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>net.bytebuddy</pattern>
+                                    <shadedPattern>${shade.package}.net.bytebuddy</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.yaml.snakeyaml</pattern>
+                                    <shadedPattern>${shade.package}.org.yaml.snakeyaml</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>io.prometheus.client</pattern>
+                                    <shadedPattern>${shade.package}.io.prometheus.client</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.checkerframework</pattern>
+                                    <shadedPattern>${shade.package}.org.checkerframework</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.slf4j</pattern>
+                                    <shadedPattern>${shade.package}.org.slf4j</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>com.google.errorprone.annotations</pattern>
+                                    <shadedPattern>${shade.package}.com.google.errorprone.annotations</shadedPattern>
+                                </relocation>
+                            </relocations>
+                            <filters>
+                                <filter>
+                                    <artifact>*:*</artifact>
+                                    <excludes>
+                                        <exclude>META-INF/*.SF</exclude>
+                                        <exclude>META-INF/*.DSA</exclude>
+                                        <exclude>META-INF/*.RSA</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                        </configuration>
+                    </execution>
+                </executions>
             </plugin>
         </plugins>
     </build>
diff --git a/agent/plugins/pom.xml b/agent/plugins/pom.xml
index fb6c327e8e1..70e5bf1ad5e 100644
--- a/agent/plugins/pom.xml
+++ b/agent/plugins/pom.xml
@@ -54,70 +54,4 @@
             <scope>provided</scope>
         </dependency>
     </dependencies>
-    
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-shade-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>shade</goal>
-                        </goals>
-                        <phase>package</phase>
-                        <configuration>
-                            <minimizeJar>true</minimizeJar>
-                            <shadedArtifactAttached>false</shadedArtifactAttached>
-                            <createDependencyReducedPom>false</createDependencyReducedPom>
-                            <shadeSourcesContent>true</shadeSourcesContent>
-                            <artifactSet>
-                                <excludes>
-                                    <exclude>com.google.errorprone:error_prone_annotations:jar:</exclude>
-                                    <exclude>com.google.code.findbugs:jsr305:jar:</exclude>
-                                    <exclude>com.google.guava:listenablefuture:jar:*</exclude>
-                                    <exclude>com.google.j2objc:j2objc-annotations:jar:*</exclude>
-                                    <exclude>org.checkerframework:checker-qual:jar:</exclude>
-                                    <exclude>com.h2database:h2:jar:</exclude>
-                                    <exclude>org.slf4j:*</exclude>
-                                    <exclude>org.apache.commons:logging:*</exclude>
-                                </excludes>
-                            </artifactSet>
-                            <relocations>
-                                <relocation>
-                                    <pattern>com.google</pattern>
-                                    <shadedPattern>${shade.package}.com.google</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>net.bytebuddy</pattern>
-                                    <shadedPattern>${shade.package}.net.bytebuddy</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>org.yaml</pattern>
-                                    <shadedPattern>${shade.package}.org.yaml</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>org.apache.commons.logging</pattern>
-                                    <shadedPattern>${shade.package}.org.apache.commons.logging</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>io.netty</pattern>
-                                    <shadedPattern>${shade.package}.io.netty</shadedPattern>
-                                </relocation>
-                            </relocations>
-                            <filters>
-                                <filter>
-                                    <artifact>*:*</artifact>
-                                    <excludes>
-                                        <exclude>META-INF/*.DSA</exclude>
-                                        <exclude>META-INF/*.SF</exclude>
-                                        <exclude>META-INF/*.RSA</exclude>
-                                    </excludes>
-                                </filter>
-                            </filters>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
 </project>
diff --git a/agent/plugins/tracing/pom.xml b/agent/plugins/tracing/pom.xml
index 96d9088ede3..dc7b673d316 100644
--- a/agent/plugins/tracing/pom.xml
+++ b/agent/plugins/tracing/pom.xml
@@ -35,8 +35,6 @@
     
     <properties>
         <opentracing.version>0.31.0</opentracing.version>
-        
-        <target.directory>${project.basedir}/../target/plugins</target.directory>
     </properties>
     
     <dependencyManagement>
@@ -69,15 +67,4 @@
             <scope>provided</scope>
         </dependency>
     </dependencies>
-    
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-shade-plugin</artifactId>
-                <configuration>
-                    <outputFile>${target.directory}/${project.build.finalName}.jar</outputFile>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
 </project>
diff --git a/agent/plugins/tracing/type/jaeger/pom.xml b/agent/plugins/tracing/type/jaeger/pom.xml
index 45cbef7639b..994cfcd3bb6 100644
--- a/agent/plugins/tracing/type/jaeger/pom.xml
+++ b/agent/plugins/tracing/type/jaeger/pom.xml
@@ -51,4 +51,79 @@
             <version>${jaeger-client.version}</version>
         </dependency>
     </dependencies>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-shade-plugin</artifactId>
+                <configuration>
+                    <minimizeJar>true</minimizeJar>
+                    <createDependencyReducedPom>false</createDependencyReducedPom>
+                    <outputFile>${target.directory}/${project.build.finalName}.jar</outputFile>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <relocations>
+                                <relocation>
+                                    <pattern>com.google.common</pattern>
+                                    <shadedPattern>${shade.package}.com.google.common</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>net.bytebuddy</pattern>
+                                    <shadedPattern>${shade.package}.net.bytebuddy</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>io.opentracing</pattern>
+                                    <shadedPattern>${shade.package}.io.opentracing</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>io.jaegertracing</pattern>
+                                    <shadedPattern>${shade.package}.io.jaegertracing</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>com.google.gson</pattern>
+                                    <shadedPattern>${shade.package}.com.google.gson</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>okhttp3</pattern>
+                                    <shadedPattern>${shade.package}.okhttp3</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>okio</pattern>
+                                    <shadedPattern>${shade.package}.okio</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.slf4j</pattern>
+                                    <shadedPattern>${shade.package}.org.slf4j</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.apache.thrift</pattern>
+                                    <shadedPattern>${shade.package}.org.apache.thrift</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>com.twitter.zipkin.thriftjava</pattern>
+                                    <shadedPattern>${shade.package}.com.twitter.zipkin.thriftjava</shadedPattern>
+                                </relocation>
+                            </relocations>
+                            <filters>
+                                <filter>
+                                    <artifact>*:*</artifact>
+                                    <excludes>
+                                        <exclude>META-INF/*.SF</exclude>
+                                        <exclude>META-INF/*.DSA</exclude>
+                                        <exclude>META-INF/*.RSA</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/agent/plugins/tracing/type/opentelemetry/pom.xml b/agent/plugins/tracing/type/opentelemetry/pom.xml
index 05e2b4dbf90..7110831f615 100644
--- a/agent/plugins/tracing/type/opentelemetry/pom.xml
+++ b/agent/plugins/tracing/type/opentelemetry/pom.xml
@@ -71,4 +71,83 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-shade-plugin</artifactId>
+                <configuration>
+                    <minimizeJar>true</minimizeJar>
+                    <createDependencyReducedPom>false</createDependencyReducedPom>
+                    <outputFile>${target.directory}/${project.build.finalName}.jar</outputFile>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <relocations>
+                                <relocation>
+                                    <pattern>com.google.common</pattern>
+                                    <shadedPattern>${shade.package}.com.google.common</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>net.bytebuddy</pattern>
+                                    <shadedPattern>${shade.package}.net.bytebuddy</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>io.grpc</pattern>
+                                    <shadedPattern>${shade.package}.io.grpc</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>io.opentelemetry</pattern>
+                                    <shadedPattern>${shade.package}.io.opentelemetry</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>io.opentelemetry</pattern>
+                                    <shadedPattern>${shade.package}.io.opentelemetry</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>okhttp3</pattern>
+                                    <shadedPattern>${shade.package}.okhttp3</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>okio</pattern>
+                                    <shadedPattern>${shade.package}.okio</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>zipkin2</pattern>
+                                    <shadedPattern>${shade.package}.zipkin2</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>com.google</pattern>
+                                    <shadedPattern>${shade.package}.com.google</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.codehaus.mojo.animal_sniffer</pattern>
+                                    <shadedPattern>${shade.package}.org.codehaus.mojo.animal_sniffer</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.checkerframework</pattern>
+                                    <shadedPattern>${shade.package}.org.checkerframework</shadedPattern>
+                                </relocation>
+                            </relocations>
+                            <filters>
+                                <filter>
+                                    <artifact>*:*</artifact>
+                                    <excludes>
+                                        <exclude>META-INF/*.SF</exclude>
+                                        <exclude>META-INF/*.DSA</exclude>
+                                        <exclude>META-INF/*.RSA</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/agent/plugins/tracing/type/opentracing/pom.xml b/agent/plugins/tracing/type/opentracing/pom.xml
index 4d40248d301..e7fb3f9c8ca 100644
--- a/agent/plugins/tracing/type/opentracing/pom.xml
+++ b/agent/plugins/tracing/type/opentracing/pom.xml
@@ -41,4 +41,55 @@
             <artifactId>opentracing-mock</artifactId>
         </dependency>
     </dependencies>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-shade-plugin</artifactId>
+                <configuration>
+                    <minimizeJar>true</minimizeJar>
+                    <createDependencyReducedPom>false</createDependencyReducedPom>
+                    <outputFile>${target.directory}/${project.build.finalName}.jar</outputFile>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <relocations>
+                                <relocation>
+                                    <pattern>com.google</pattern>
+                                    <shadedPattern>${shade.package}.com.google</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>net.bytebuddy</pattern>
+                                    <shadedPattern>${shade.package}.net.bytebuddy</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>io.opentracing</pattern>
+                                    <shadedPattern>${shade.package}.io.opentracing</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.checkerframework</pattern>
+                                    <shadedPattern>${shade.package}.org.checkerframework</shadedPattern>
+                                </relocation>
+                            </relocations>
+                            <filters>
+                                <filter>
+                                    <artifact>*:*</artifact>
+                                    <excludes>
+                                        <exclude>META-INF/*.SF</exclude>
+                                        <exclude>META-INF/*.DSA</exclude>
+                                        <exclude>META-INF/*.RSA</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/agent/plugins/tracing/type/pom.xml b/agent/plugins/tracing/type/pom.xml
index 00a1a7aa2bb..28f588035ea 100644
--- a/agent/plugins/tracing/type/pom.xml
+++ b/agent/plugins/tracing/type/pom.xml
@@ -36,7 +36,7 @@
     </modules>
     
     <properties>
-        <target.directory>${project.basedir}/../../target/plugins</target.directory>
+        <target.directory>${project.basedir}/../target/plugins</target.directory>
     </properties>
     
     <dependencies>
@@ -54,15 +54,4 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
-    
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-shade-plugin</artifactId>
-                <configuration>
-                    <outputFile>${target.directory}/${project.build.finalName}.jar</outputFile>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
 </project>
diff --git a/agent/plugins/tracing/type/zipkin/pom.xml b/agent/plugins/tracing/type/zipkin/pom.xml
index 710cedf5fe5..ac1e4aad7a2 100644
--- a/agent/plugins/tracing/type/zipkin/pom.xml
+++ b/agent/plugins/tracing/type/zipkin/pom.xml
@@ -55,4 +55,63 @@
             <version>${zipkin-reporter.version}</version>
         </dependency>
     </dependencies>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-shade-plugin</artifactId>
+                <configuration>
+                    <minimizeJar>true</minimizeJar>
+                    <createDependencyReducedPom>false</createDependencyReducedPom>
+                    <outputFile>${target.directory}/${project.build.finalName}.jar</outputFile>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <relocations>
+                                <relocation>
+                                    <pattern>com.google</pattern>
+                                    <shadedPattern>${shade.package}.com.google</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>net.bytebuddy</pattern>
+                                    <shadedPattern>${shade.package}.net.bytebuddy</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>okhttp3</pattern>
+                                    <shadedPattern>${shade.package}.okhttp3</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>okio</pattern>
+                                    <shadedPattern>${shade.package}.okio</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>zipkin2</pattern>
+                                    <shadedPattern>${shade.package}.zipkin2</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>brave</pattern>
+                                    <shadedPattern>${shade.package}.brave</shadedPattern>
+                                </relocation>
+                            </relocations>
+                            <filters>
+                                <filter>
+                                    <artifact>*:*</artifact>
+                                    <excludes>
+                                        <exclude>META-INF/*.SF</exclude>
+                                        <exclude>META-INF/*.DSA</exclude>
+                                        <exclude>META-INF/*.RSA</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/test/e2e/agent/plugins/opentelemetry/src/test/assembly/shardingsphere-proxy-agent-opentelemetry-assembly.xml b/test/e2e/agent/plugins/opentelemetry/src/test/assembly/shardingsphere-proxy-agent-opentelemetry-assembly.xml
index 4378358c708..1d124af1034 100644
--- a/test/e2e/agent/plugins/opentelemetry/src/test/assembly/shardingsphere-proxy-agent-opentelemetry-assembly.xml
+++ b/test/e2e/agent/plugins/opentelemetry/src/test/assembly/shardingsphere-proxy-agent-opentelemetry-assembly.xml
@@ -25,7 +25,7 @@
     
     <fileSets>
         <fileSet>
-            <directory>${project.basedir}/../../../../../agent/plugins/tracing/target/plugins</directory>
+            <directory>${project.basedir}/../../../../../agent/plugins/tracing/type/target/plugins</directory>
             <outputDirectory>./agent/plugins</outputDirectory>
             <includes>
                 <include>shardingsphere-agent-tracing-opentelemetry-*.jar</include>