SpringBoot 或 SOFABoot 升级为基座
前提条件
- SpringBoot 版本 >= 2.3.0(针对 SpringBoot 用户)
- SOFABoot 版本 >= 3.9.0 或 SOFABoot >= 4.0.0(针对 SOFABoot 用户)
接入步骤
代码与配置修改
修改 application.properties
# 需要定义应用名
spring.application.name = ${替换为实际基座应用名}
修改主 pom.xml
<properties>
- <sofa.ark.verion>2.2.5-SNAPSHOT</sofa.ark.verion>
+ <sofa.ark.verion>2.2.5</sofa.ark.verion>
<sofa.serverless.runtime.version>0.5.3</sofa.serverless.runtime.version>
</properties>
<dependency>
diff --git a/docs/public/docs/tutorials/module-development/_print/index.html b/docs/public/docs/tutorials/module-development/_print/index.html
index 048fafcf5..284b7934e 100644
--- a/docs/public/docs/tutorials/module-development/_print/index.html
+++ b/docs/public/docs/tutorials/module-development/_print/index.html
@@ -9,7 +9,7 @@
<plugin>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-ark-maven-plugin</artifactId>
- <version>2.2.5-SNAPSHOT</version>
+ <version>2.2.5</version>
<executions>
<execution>
<id>default-cli</id>
diff --git a/docs/public/docs/tutorials/module-development/module-slimming/index.html b/docs/public/docs/tutorials/module-development/module-slimming/index.html
index ba6d195e0..a9257e1b7 100644
--- a/docs/public/docs/tutorials/module-development/module-slimming/index.html
+++ b/docs/public/docs/tutorials/module-development/module-slimming/index.html
@@ -6,15 +6,15 @@
提高模块安装的速度,减少模块包大小,减少启动依赖,控制模块安装耗时 < 30秒,甚至 < 5秒。 模块启动后 Spring 上下文中会创建很多对象,如果启用了模块热卸载,可能无法完全回收,安装次数过多会造成 Old 区、Metaspace 区开销大,触发频繁 FullGC,所有要控制单模块包大小 < 5MB。这样不替换或重启基座也能热部署热卸载数百次。 一键自动瘦身 瘦身原则 构建 ark-biz jar 包的原则是,在保证模块功能的前提下,将框架、中间件等通用的包尽量放置到基座中,模块中复用基座的包,这样打出的 ark-biz jar 会更加轻量。在复杂应用中,为了更好的使用模块自动瘦身功能,需要在模块瘦身配置 (模块根目录/conf/ark/文件名.txt) 中,在样例给出的配置名单的基础上,按照既定格式,排除更多的通用依赖包。
步骤一 在「模块项目根目录/conf/ark/文件名.txt」中(比如:my-module/conf/ark/rules.txt),按照如下格式配置需要下沉到基座的框架和中间件常用包。您也可以直接复制默认的 rules.txt 文件内容到您的项目中。
excludeGroupIds=org.apache* excludeArtifactIds=commons-lang 步骤二 在模块打包插件中,引入上述配置文件:
- com.alipay.sofa sofa-ark-maven-plugin 2.2.5-SNAPSHOT default-cli repackage true ./target biz1 rules.txt biz1 true
+ com.alipay.sofa sofa-ark-maven-plugin 2.2.5 default-cli repackage true ./target biz1 rules.txt biz1 true
@@ -28,7 +28,7 @@
<plugin>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-ark-maven-plugin</artifactId>
- <version>2.2.5-SNAPSHOT</version>
+ <version>2.2.5</version>
<executions>
<execution>
<id>default-cli</id>
diff --git a/samples/dubbo-samples/rpc/dubbo26/pom.xml b/samples/dubbo-samples/rpc/dubbo26/pom.xml
index b0ff45ddb..a298434b5 100644
--- a/samples/dubbo-samples/rpc/dubbo26/pom.xml
+++ b/samples/dubbo-samples/rpc/dubbo26/pom.xml
@@ -19,7 +19,7 @@
8
2.6.12
2.7.16
- 2.2.5-SNAPSHOT
+ 2.2.5
0.5.3
3.4.2
3.8.1
diff --git a/samples/dubbo-samples/rpc/dubbo27/pom.xml b/samples/dubbo-samples/rpc/dubbo27/pom.xml
index 88fd0ecff..b6b3fadd9 100644
--- a/samples/dubbo-samples/rpc/dubbo27/pom.xml
+++ b/samples/dubbo-samples/rpc/dubbo27/pom.xml
@@ -19,7 +19,7 @@
8
2.7.23
2.7.16
- 2.2.5-SNAPSHOT
+ 2.2.5
0.5.0
3.4.2
3.8.1
diff --git a/samples/dubbo-samples/rpc/dubbo3/pom.xml b/samples/dubbo-samples/rpc/dubbo3/pom.xml
index fe9d5a4cc..3e9f73e07 100644
--- a/samples/dubbo-samples/rpc/dubbo3/pom.xml
+++ b/samples/dubbo-samples/rpc/dubbo3/pom.xml
@@ -21,7 +21,7 @@
UTF-8
UTF-8
2.7.16
- 2.2.5-SNAPSHOT
+ 2.2.5
0.5.3
3.4.2
3.8.1
diff --git a/samples/sofaboot-samples/dynamic-stock/README.md b/samples/sofaboot-samples/dynamic-stock/README.md
index cbf418675..3729c76ab 100644
--- a/samples/sofaboot-samples/dynamic-stock/README.md
+++ b/samples/sofaboot-samples/dynamic-stock/README.md
@@ -42,7 +42,7 @@ biz 也是普通 SOFABoot,修改打包插件方式为 sofaArk biz 模块打包
com.alipay.sofa
sofa-ark-maven-plugin
- 2.2.5-SNAPSHOT
+ 2.2.5
default-cli
diff --git a/samples/sofaboot-samples/pom.xml b/samples/sofaboot-samples/pom.xml
index 9fc151590..ceac3d9f4 100644
--- a/samples/sofaboot-samples/pom.xml
+++ b/samples/sofaboot-samples/pom.xml
@@ -21,7 +21,7 @@
1.8
- 2.2.5-SNAPSHOT
+ 2.2.5
0.5.5-SNAPSHOT
2.9.1
1.3.2
diff --git a/samples/springboot-samples/pom.xml b/samples/springboot-samples/pom.xml
index 84d5ba242..42f14a35e 100644
--- a/samples/springboot-samples/pom.xml
+++ b/samples/springboot-samples/pom.xml
@@ -20,7 +20,7 @@
2.7.16
1.8
- 2.2.6-SNAPSHOT
+ 2.2.5
0.5.5-SNAPSHOT
3.4.2
1.7.1
diff --git a/samples/springboot-samples/web/tomcat/biz1/src/main/java/com/alipay/sofa/web/biz1/Biz1Application.java b/samples/springboot-samples/web/tomcat/biz1/src/main/java/com/alipay/sofa/web/biz1/Biz1Application.java
index 019bee68d..a9cff4b9e 100644
--- a/samples/springboot-samples/web/tomcat/biz1/src/main/java/com/alipay/sofa/web/biz1/Biz1Application.java
+++ b/samples/springboot-samples/web/tomcat/biz1/src/main/java/com/alipay/sofa/web/biz1/Biz1Application.java
@@ -1,10 +1,7 @@
package com.alipay.sofa.web.biz1;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.ResourceLoader;
diff --git a/samples/springboot-samples/web/webflux/biz/pom.xml b/samples/springboot-samples/web/webflux/biz/pom.xml
index b411617ed..d8a346bc4 100644
--- a/samples/springboot-samples/web/webflux/biz/pom.xml
+++ b/samples/springboot-samples/web/webflux/biz/pom.xml
@@ -49,7 +49,7 @@
com.alipay.sofa
sofa-ark-maven-plugin
- 2.2.5-SNAPSHOT
+ 2.2.5
default-cli
diff --git a/samples/springboot3-samples/db/mybatis/README.md b/samples/springboot3-samples/db/mybatis/README.md
index 82e119767..43a2e127a 100644
--- a/samples/springboot3-samples/db/mybatis/README.md
+++ b/samples/springboot3-samples/db/mybatis/README.md
@@ -102,7 +102,7 @@ biz 包含两个模块,分别为 biz1 和 biz2, 都是普通 springboot,修
com.alipay.sofa
sofa-ark-maven-plugin
- 2.2.5-SNAPSHOT
+ 2.2.5
default-cli
diff --git a/samples/springboot3-samples/logging/README.md b/samples/springboot3-samples/logging/README.md
index dc57fd288..2ffa81042 100644
--- a/samples/springboot3-samples/logging/README.md
+++ b/samples/springboot3-samples/logging/README.md
@@ -67,7 +67,7 @@ biz 包含两个模块,分别为 biz1 和 biz2, 都是普通 springboot,修
com.alipay.sofa
sofa-ark-maven-plugin
- 2.2.5-SNAPSHOT
+ 2.2.5
default-cli
diff --git a/samples/springboot3-samples/msg/kafka/README.md b/samples/springboot3-samples/msg/kafka/README.md
index 2c94f0e20..9224d6b5e 100644
--- a/samples/springboot3-samples/msg/kafka/README.md
+++ b/samples/springboot3-samples/msg/kafka/README.md
@@ -78,7 +78,7 @@ biz 包含两个模块,分别为 biz1 和 biz2, 都是普通 springboot,修
com.alipay.sofa
sofa-ark-maven-plugin
- 2.2.5-SNAPSHOT
+ 2.2.5
default-cli
diff --git a/samples/springboot3-samples/web/tomcat/README.md b/samples/springboot3-samples/web/tomcat/README.md
index 75b003571..5ba6b6091 100644
--- a/samples/springboot3-samples/web/tomcat/README.md
+++ b/samples/springboot3-samples/web/tomcat/README.md
@@ -39,7 +39,7 @@ biz 包含两个模块,分别为 biz1 和 biz2, 都是普通 springboot,修
com.alipay.sofa
sofa-ark-maven-plugin
- 2.2.5-SNAPSHOT
+ 2.2.5
default-cli
diff --git a/sofa-serverless-runtime/pom.xml b/sofa-serverless-runtime/pom.xml
index 7deae8aef..bf2f39386 100644
--- a/sofa-serverless-runtime/pom.xml
+++ b/sofa-serverless-runtime/pom.xml
@@ -9,7 +9,7 @@
pom
- 2.2.5-SNAPSHOT
+ 2.2.5
2.7.15
1.2.9
0.5.5-SNAPSHOT