亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Config服務端連接Git配置的技巧

 更新時間:2021年09月14日 09:33:50   作者:為BUG消得人憔悴  
今天小編抽空給大家介紹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

到此這篇關于Config服務端連接Git配置的技巧的文章就介紹到這了,更多相關Config服務端連接Git配置內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

相關文章

最新評論