0
点赞
收藏
分享

微信扫一扫

Spring cloud:分布式module


 

  1. 新增一个业务模块,统一将业务模块放在hc-modeules下
  2. 在resources资源目录下新增application-properties.yml文件  该文件用来配置注册中心、配置中心信息等..
  3. 在pom.xml文件添加jar包的依赖以及配置指向的父级

<parent>
		<groupId>com.github.pig</groupId>
		<artifactId>pig-modules</artifactId>
		<version>1.3.1</version>
	</parent>

  1. 同时在父工程的pom.xml里加入子工程

<modules>
        <module>pig-daemon-service</module>
        <module>pig-mc-service</module>
        <module>pig-sso-client-demo</module>
        <module>pig-upms-service</module>
    </modules>

  1. 添加main启动类,扫描其他需要引入的公共模块
  2. 新增服务网关访问路径
  3. 在你的配置仓库新增工程的配置文件,文件命名的规则{application.name}-{profiles.active}.yml,hc-upms-service-dev.yml

 

 


Spring cloud:分布式module_配置文件

组成

 项目架构

举报

相关推荐

0 条评论