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 09:01:12 UTC

[shardingsphere] branch master updated: Add plugin-core to lib folder (#23223)

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

zhonghongsheng 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 3ab8747cdeb Add plugin-core to lib folder (#23223)
3ab8747cdeb is described below

commit 3ab8747cdeb43c9c3f115edecf8c6fb5b1880ec6
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sat Dec 31 17:01:02 2022 +0800

    Add plugin-core to lib folder (#23223)
    
    * Refactor pom of agent-core
    
    * Refactor AdvisorConfigurationLoader
    
    * Refactor ClassLoaderContext
    
    * Refactor AgentTransformer
    
    * Refactor AgentClassLoader
    
    * Add plugin-core to lib folder
    
    * Add plugin-core to lib folder
---
 agent/core/pom.xml                                        |  5 -----
 .../assembly/shardingsphere-agent-binary-distribution.xml |  7 +++++++
 agent/plugins/core/pom.xml                                | 15 +++++++++++++++
 agent/plugins/pom.xml                                     | 13 +++++++++----
 4 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/agent/core/pom.xml b/agent/core/pom.xml
index 1bf64318a0c..d87ec334205 100644
--- a/agent/core/pom.xml
+++ b/agent/core/pom.xml
@@ -37,11 +37,6 @@
             <artifactId>shardingsphere-agent-api</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.apache.shardingsphere</groupId>
-            <artifactId>shardingsphere-agent-plugin-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         
         <dependency>
             <groupId>net.bytebuddy</groupId>
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 e1cd1a7dfe5..d38991331cb 100644
--- a/agent/distribution/src/main/assembly/shardingsphere-agent-binary-distribution.xml
+++ b/agent/distribution/src/main/assembly/shardingsphere-agent-binary-distribution.xml
@@ -64,6 +64,13 @@
                 <include>**.jar</include>
             </includes>
         </fileSet>
+        <fileSet>
+            <directory>../plugins/core/target/lib</directory>
+            <outputDirectory>./lib</outputDirectory>
+            <includes>
+                <include>**.jar</include>
+            </includes>
+        </fileSet>
         <fileSet>
             <directory>../plugins/metrics/target/lib</directory>
             <outputDirectory>./lib</outputDirectory>
diff --git a/agent/plugins/core/pom.xml b/agent/plugins/core/pom.xml
index 82f3f19d5e7..e0345484623 100644
--- a/agent/plugins/core/pom.xml
+++ b/agent/plugins/core/pom.xml
@@ -26,4 +26,19 @@
     </parent>
     <artifactId>shardingsphere-agent-plugin-core</artifactId>
     <name>${project.artifactId}</name>
+    
+    <properties>
+        <target.directory>${project.basedir}/target/lib</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/pom.xml b/agent/plugins/pom.xml
index 9d27d65806e..948e607ce25 100644
--- a/agent/plugins/pom.xml
+++ b/agent/plugins/pom.xml
@@ -43,6 +43,11 @@
             <scope>provided</scope>
         </dependency>
         
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>net.bytebuddy</groupId>
             <artifactId>byte-buddy</artifactId>
@@ -78,6 +83,10 @@
                                 </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>
@@ -86,10 +95,6 @@
                                     <pattern>org.yaml</pattern>
                                     <shadedPattern>${shade.package}.org.yaml</shadedPattern>
                                 </relocation>
-                                <relocation>
-                                    <pattern>com.google</pattern>
-                                    <shadedPattern>${shade.package}.com.google</shadedPattern>
-                                </relocation>
                                 <relocation>
                                     <pattern>org.apache.commons</pattern>
                                     <shadedPattern>${shade.package}.org.apache.commons</shadedPattern>