更新时间:2020-05-29 16:19
一个 SOFABoot 工程可以包含多个模块,每个模块主要包括下述 2 个部分:
sofa-module.properties
。META-INF/spring
目录下。新建工程默认无 spring 文件夹,需用户创建。sofa-module.properties
的配置内容,示例如下:
Module-Name=com.alipay.test.biz.service.impl
Spring-Parent=com.alipay.test.common.dal
Require-Module=com.alipay.test.biz.shared
Module-Profile=dev
对配置文件中待配置属性对应的键,说明如下:
Module-Name
Module-Name
是 SOFABoot 模块的名称,也是 SOFABoot 模块的唯一标识符。Module-Name
不得重复。Spring-Parent
Spring-Parent
主要用来打通 2 个你期望打通的模块的 Spring 上下文。Require-Module
Require-Module
用于定义模块之间的依赖顺序,值是以逗号分隔的 SOFABoot 模块名列表。Require-Module=com.alipay.test.biz.shared
表示下述含义:com.alipay.test.biz.shared
模块。com.alipay.test.biz.shared
模块将先于本模块启动 Spring 上下文。init
方法里面,需要使用 SOFA Reference 调用这个 SOFA JVM Service。Require-Module
来强制 A 模块在 B 模块之前启动。Module-Profile:支持 SOFABoot Profile 能力,详情参见 模块激活配置。
在文档使用中是否遇到以下问题
更多建议
匿名提交