You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ji...@apache.org on 2026/03/11 12:50:35 UTC
(shardingsphere) branch master updated: Move hive and seata-at dependencies to opt-lib in proxy distribution (#38394)
This is an automated email from the ASF dual-hosted git repository.
jianglongtao 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 27d07f8af34 Move hive and seata-at dependencies to opt-lib in proxy distribution (#38394)
27d07f8af34 is described below
commit 27d07f8af3445f04db2678034af224d83cd39274
Author: Raigor <ra...@gmail.com>
AuthorDate: Wed Mar 11 20:50:29 2026 +0800
Move hive and seata-at dependencies to opt-lib in proxy distribution (#38394)
---
.../shardingsphere-proxy-binary-distribution.xml | 16 ++++++++++++++++
.../shardingsphere-proxy/optional-plugins/_index.cn.md | 8 +++++---
.../shardingsphere-proxy/optional-plugins/_index.en.md | 6 ++++--
.../optional-plugins/seata-at/_index.cn.md | 5 ++++-
.../optional-plugins/seata-at/_index.en.md | 5 ++++-
.../user-manual/shardingsphere-proxy/startup/bin.cn.md | 4 ++++
.../user-manual/shardingsphere-proxy/startup/bin.en.md | 5 +++++
7 files changed, 42 insertions(+), 7 deletions(-)
diff --git a/distribution/proxy/src/main/assembly/shardingsphere-proxy-binary-distribution.xml b/distribution/proxy/src/main/assembly/shardingsphere-proxy-binary-distribution.xml
index 12e02ed065a..2d00c5b740d 100644
--- a/distribution/proxy/src/main/assembly/shardingsphere-proxy-binary-distribution.xml
+++ b/distribution/proxy/src/main/assembly/shardingsphere-proxy-binary-distribution.xml
@@ -78,7 +78,23 @@
<fileMode>0644</fileMode>
<excludes>
<exclude>org.apache.shardingsphere:shardingsphere-agent*</exclude>
+ <exclude>org.apache.shardingsphere:*-hive</exclude>
+ <exclude>org.apache.shardingsphere:*-seata-at</exclude>
</excludes>
</dependencySet>
+ <dependencySet>
+ <outputDirectory>opt-lib/hive</outputDirectory>
+ <fileMode>0644</fileMode>
+ <includes>
+ <include>org.apache.shardingsphere:*-hive</include>
+ </includes>
+ </dependencySet>
+ <dependencySet>
+ <outputDirectory>opt-lib/seata-at</outputDirectory>
+ <fileMode>0644</fileMode>
+ <includes>
+ <include>org.apache.shardingsphere:*-seata-at</include>
+ </includes>
+ </dependencySet>
</dependencySets>
</assembly>
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.cn.md
index f5077bc37a3..4a3f000eace 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.cn.md
@@ -3,11 +3,13 @@ title = "可选插件"
weight = 6
+++
-ShardingSphere 默认情况下仅包含核心 SPI 的实现,在 Git Source 存在一部分包含第三方依赖的 SPI
-实现的插件未包含在内。可在 https://central.sonatype.com/ 进行检索。
+ShardingSphere 默认情况下仅加载核心 SPI 的实现。
+二进制发布包会在 `opt-lib` 目录中随包提供一部分由 ShardingSphere 维护的可选插件,但这些插件不会默认加入 classpath。
+若要启用这些插件,需要先将对应的 JAR 复制到 `ext-lib`,再按插件文档补充第三方依赖。
+其他未随包提供的插件,可在 https://central.sonatype.com/ 进行检索。
所有插件对应的 SPI 和 SPI 的已有实现类均可在 https://shardingsphere.apache.org/document/current/cn/dev-manual/ 检索。
-如果 ShardingSphere-Proxy 需要使用可选插件,需要在 Maven Central 下载包含其 SPI 实现的 JAR 和其依赖的 JAR。
+如果 ShardingSphere-Proxy 需要使用可选插件,需要按具体插件文档准备其 SPI 实现 JAR 和所依赖的第三方 JAR。
下以 `groupId:artifactId` 的表现形式列出所有的可选插件。
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.en.md b/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.en.md
index eebd93a65b4..e4e8944feb6 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.en.md
@@ -3,8 +3,10 @@ title = "Optional Plugins"
weight = 6
+++
-ShardingSphere only includes the implementation of the core SPI by default, and there is a part of the SPI that contains third-party dependencies in Git Source
-Implemented plugins are not included. Retrievable at https://central.sonatype.com/ .
+ShardingSphere only loads the implementation of the core SPI by default.
+The binary release package ships some ShardingSphere-maintained optional plugins in the `opt-lib` directory, but they are not added to the classpath by default.
+To enable these plugins, copy the corresponding jars to `ext-lib` first, then add the required third-party dependencies according to the plugin documentation.
+Other plugins that are not shipped with the binary package can be retrieved at https://central.sonatype.com/ .
SPI and existing implementation classes of SPI corresponding to all plugins can be retrieved at https://shardingsphere.apache.org/document/current/cn/dev-manual/ .
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/seata-at/_index.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/seata-at/_index.cn.md
index ba77109b232..b581597c412 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/seata-at/_index.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/seata-at/_index.cn.md
@@ -29,6 +29,9 @@ ShardingSphere Proxy 或 GraalVM Native Image 形态的 ShardingSphere Proxy Nat
4. 创建包含 Seata Client 和 Seata 集成模块的 ShardingSphere Proxy
5. 为 ShardingSphere Proxy 添加 Seata 配置
+如果使用官方二进制发布包或 Docker Image,请先将 `opt-lib/seata-at` 目录中的 JAR 复制到 `ext-lib`,
+再补充 Seata Client 的第三方依赖。
+
## 配置示例
### 确认 Seata Client 的 JAR 和依赖列表
@@ -120,7 +123,7 @@ services:
context: .
dockerfile_inline: |
FROM apache/shardingsphere-proxy:latest
- RUN wget https://repo1.maven.org/maven2/org/apache/shardingsphere/shardingsphere-transaction-base-seata-at/5.5.2/shardingsphere-transaction-base-seata-at-5.5.2.jar --directory-prefix=/opt/shardingsphere-proxy/ext-lib
+ RUN cp /opt/shardingsphere-proxy/opt-lib/seata-at/*.jar /opt/shardingsphere-proxy/ext-lib/
RUN wget https://repo1.maven.org/maven2/org/apache/seata/seata-all/2.5.0/seata-all-2.5.0.jar --directory-prefix=/opt/shardingsphere-proxy/ext-lib
RUN wget https://repo1.maven.org/maven2/org/springframework/spring-context/5.3.39/spring-context-5.3.39.jar --directory-prefix=/opt/shardingsphere-proxy/ext-lib
RUN wget https://repo1.maven.org/maven2/org/springframework/spring-expression/5.3.39/spring-expression-5.3.39.jar --directory-prefix=/opt/shardingsphere-proxy/ext-lib
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/seata-at/_index.en.md b/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/seata-at/_index.en.md
index c805aa02659..bc9878fe571 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/seata-at/_index.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/seata-at/_index.en.md
@@ -29,6 +29,9 @@ The following discussion takes ShardingSphere Proxy using Seata Client 2.5.0 as
4. Create ShardingSphere Proxy containing Seata Client and Seata integration module
5. Add Seata configuration to ShardingSphere Proxy
+If the official binary release package or Docker Image is used, copy the jars in `opt-lib/seata-at` to `ext-lib` first,
+then add the third-party dependencies required by Seata Client.
+
## Configuration example
### Confirm the JAR and dependency list of Seata Client
@@ -123,7 +126,7 @@ services:
context: .
dockerfile_inline: |
FROM apache/shardingsphere-proxy:latest
- RUN wget https://repo1.maven.org/maven2/org/apache/shardingsphere/shardingsphere-transaction-base-seata-at/5.5.2/shardingsphere-transaction-base-seata-at-5.5.2.jar --directory-prefix=/opt/shardingsphere-proxy/ext-lib
+ RUN cp /opt/shardingsphere-proxy/opt-lib/seata-at/*.jar /opt/shardingsphere-proxy/ext-lib/
RUN wget https://repo1.maven.org/maven2/org/apache/seata/seata-all/2.5.0/seata-all-2.5.0.jar --directory-prefix=/opt/shardingsphere-proxy/ext-lib
RUN wget https://repo1.maven.org/maven2/org/springframework/spring-context/5.3.39/spring-context-5.3.39.jar --directory-prefix=/opt/shardingsphere-proxy/ext-lib
RUN wget https://repo1.maven.org/maven2/org/springframework/spring-expression/5.3.39/spring-expression-5.3.39.jar --directory-prefix=/opt/shardingsphere-proxy/ext-lib
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/startup/bin.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/startup/bin.cn.md
index c475b7dfba6..9dc92c22595 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/startup/bin.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/startup/bin.cn.md
@@ -17,6 +17,9 @@ weight = 1
在[下载页面](https://shardingsphere.apache.org/document/current/cn/downloads/)获取。
+注意:二进制发布包中的 `lib` 目录仅包含默认启动所需依赖。部分可选插件会随包放入 `opt-lib` 目录,但不会默认加载。
+如果需要启用这类插件,请先将对应目录下的 JAR 复制到 `ext-lib`,再补充该插件所需的第三方依赖。
+
2. 配置 `conf/global.yaml`
ShardingSphere-Proxy 运行模式在 `global.yaml` 中配置,配置格式与 ShardingSphere-JDBC 一致,请参考[模式配置](/cn/user-manual/shardingsphere-jdbc/yaml-config/mode/)。
@@ -46,6 +49,7 @@ ShardingSphere-Proxy 默认集成 ZooKeeper Curator 客户端,集群模式使
与 ShardingSphere-JDBC 使用方式相同。
具体可参考[分布式事务](/cn/user-manual/shardingsphere-jdbc/special-api/transaction/)。
+如果使用 Seata AT 模式,请先将 `opt-lib/seata-at` 目录下的 JAR 复制至 `ext-lib`,再补充 Seata Client 及其额外依赖。
7. (可选)引入自定义算法
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/startup/bin.en.md b/docs/document/content/user-manual/shardingsphere-proxy/startup/bin.en.md
index 3f53bdcd33c..a7bb616646d 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/startup/bin.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/startup/bin.en.md
@@ -17,6 +17,10 @@ Start the Proxy with a binary package requires an environment with Java JRE 8 or
Obtain the binary release package of ShardingSphere-Proxy on the [download page](https://shardingsphere.apache.org/document/current/en/downloads/).
+Notice: The `lib` directory in the binary release package only contains the dependencies required for the default startup.
+Some optional plugin jars are shipped in the `opt-lib` directory, but they are not loaded by default.
+To enable such plugins, copy the corresponding jars from `opt-lib` to `ext-lib` first, then add the required third-party dependencies.
+
2. Configure `conf/global.yaml`
ShardingSphere-Proxy's operational mode is configured on `global.yaml`, and its configuration mode is the same with that of ShardingSphere-JDBC. Refer to [mode of configuration](/en/user-manual/shardingsphere-jdbc/yaml-config/mode/).
@@ -47,6 +51,7 @@ If the cluster mode uses Etcd, please copy [vertx-grpc 4.5.1](https://repo1.mave
It is the same with ShardingSphere-JDBC.
Please refer to [Distributed Transaction](/en/user-manual/shardingsphere-jdbc/special-api/transaction/) for more details.
+If Seata AT mode is used, copy the jars under `opt-lib/seata-at` to `ext-lib` first, then add Seata Client and its extra dependencies.
7. Introduce custom algorithm (Optional)