Config服务端连接Git配置的技巧

Config:服务端连接Git配置
1、导入依赖
<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-config-server</artifactId>
    </dependency>
</dependencies>
2、编写配置文件
server:
  port: 3344
spring:
  application:
    name: Git-config-3344
  #连接远程仓库
  cloud:
    config:
      server:
        git:
          uri: https://gitee.com/xiao-yunshan/gittest.git
3、编写启动类
@SpringBootApplication
@EnableConfigServer
public class Git_3344 {
    public static void main(String[] args) {
        SpringApplication.run(Git_3344.class,args);
    }
}
4、启动访问

http://localhost:3344/application-dev.yml

收藏 (0)
评论列表
正在载入评论列表...
我是有底线的
为您推荐
    暂时没有数据