欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Config服務(wù)端連接Git配置的技巧

 更新時(shí)間:2021年09月14日 09:33:50   作者:為BUG消得人憔悴  
今天小編抽空給大家介紹Config服務(wù)端連接Git配置的技巧,代碼分為導(dǎo)入依賴和編寫配置文件的方法,代碼簡(jiǎn)單易懂,對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友參考下吧

Config:服務(wù)端連接Git配置,代碼如下所示:

1、導(dǎo)入依賴

<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
  #連接遠(yuǎn)程倉(cāng)庫(kù)
  cloud:
    config:
      server:
        git:
          uri: https://gitee.com/xiao-yunshan/gittest.git

3、編寫啟動(dòng)類

@SpringBootApplication
@EnableConfigServer
public class Git_3344 {
    public static void main(String[] args) {
        SpringApplication.run(Git_3344.class,args);
    }
}

4、啟動(dòng)訪問(wèn)

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

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

相關(guān)文章

最新評(píng)論