Closed lvjing2 closed 11 months ago
普通 SpringBoot 改造成基座,照理只需要引入如下依赖即可。
<properties> <sofa.serverless.runtime.version>0.1.2</sofa.serverless.runtime.version> </properties> <dependency> <groupId>com.alipay.sofa.serverless</groupId> <artifactId>sofa-serverless-runtime-starter</artifactId> <version>${sofa.serverless.runtime.version}</version> </dependency>
但是只引入该依赖,会报错
不会报错
spring.application.name=${换成实际应用名}
<properties> <sofa.serverless.runtime.version>0.1.2</sofa.serverless.runtime.version> </properties>
<dependencies> <dependency> <groupId>com.alipay.sofa.serverless</groupId> <artifactId>sofa-serverless-runtime-starter</artifactId> <version>${sofa.serverless.runtime.version}</version> </dependency> </dependencies>
-Dsofa.ark.embed.enable=true
pom 里添加 actuator 依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
SOFAServerless 基座runtime 里 arklet 部分强依赖了 actuator,需要基座里主动增加该依赖。
对于基座改造会有额外的依赖,使得基座的改造不能纯粹引入我们的 runtime starter 完成初始化。
Arklet 里对 actuator 的依赖,改成自动识别的方式,如果基座里有 actuator 才执行 health 那段逻辑。
当前先认为 actuator 是 arklet 必带能力,可以 compile 依赖进来。所以不需改动代码
Describe the question or bug
普通 SpringBoot 改造成基座,照理只需要引入如下依赖即可。
但是只引入该依赖,会报错
Expect behavior
不会报错
Steps to reproduce
spring.application.name=${换成实际应用名}
,否则会报这个错误-Dsofa.ark.embed.enable=true
修复方式
pom 里添加 actuator 依赖
原因
SOFAServerless 基座runtime 里 arklet 部分强依赖了 actuator,需要基座里主动增加该依赖。
问题影响
对于基座改造会有额外的依赖,使得基座的改造不能纯粹引入我们的 runtime starter 完成初始化。
修复方式
Arklet 里对 actuator 的依赖,改成自动识别的方式,如果基座里有 actuator 才执行 health 那段逻辑。