Skip to content

SOFA BOOT 版本4.5.0 项目没有做到模块化隔离 如何解决? #1393

@sidekick-boy

Description

@sidekick-boy

SOFA BOOT 版本4.5.0 项目没有做到模块化隔离 如何解决?

  1. 子模块一些初始化实现CommandLineRunner接口的业务没有执行, 必须在主类SpringApplication上加载包扫描才能够执行;
  2. SOFABoot Profile功能没有生效,比如com.alipay.sofa.boot.active-profiles=sdk , 通过配置Module-Profile来限制 A、C模块生效、B、D、E模块不生效,但是服务启动的时候,各个子模块的初始化业务还是执行了
  3. 最后我在A模块调用B模块的***Service, 通过@SofaReference 或者 @Autowired,都是可以的。

综上所述,我可能引入了个假的sofa boot, 其实目前它还是一个Spring Boot项目,怎么解决啊,求助大神指导:
父Pom引入

  <dependency>
      <groupId>com.alipay.sofa</groupId>
      <artifactId>sofa-boot-starter</artifactId>
  </dependency>

主类run 模块pom引入

  <dependency>
      <groupId>com.alipay.sofa</groupId>
      <artifactId>isle-sofa-boot-starter</artifactId>
  </dependency>
  <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
  </dependency>

各个子模块pom引入

        <dependency>
            <groupId>com.alipay.sofa</groupId>
            <artifactId>runtime-sofa-boot-starter</artifactId>
        </dependency>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions