日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > javascript >内容正文

javascript

Spring Cloud Config git版

發布時間:2023/12/20 javascript 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Spring Cloud Config git版 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

由于在學習這塊內容的時候還不會使用gitHub所以就用了osc的碼云

config server

POM文件

<dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-config-server</artifactId> </dependency>

?

git版配置文件

spring:application:name: config-servercloud:config:server:git:uri: https://gitee.com/qubaba/spring-cloud-config # git路徑 username: # 私有倉庫的話需要輸入git的賬號密碼password: search-paths: /spring-cloud-config # 查找該路徑下的所有文件default-label: spring-cloud-config # 默認的分支

?

啟動類

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

?


?

關鍵注解為:@EnableConfigServer表示啟動類為配置服務類。

?

訪問到配置服務器的配置文件后會在本地生成一份配置文件的副本。

config Client

POM文件

<dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-config</artifactId> </dependency>

?

配置文件

spring cloud config 的配置文件需要提前加載所以需要在resources目錄下新建文件bootstrap.yml文件

spring:profiles:active: dev # 默認加載配置文件application:name: configcloud:config:uri: http://localhost:9000 # 配置服務器地址 name: ${spring.application.name} # application Nameprofile: ${spring.profiles.active} # 那個類型的配置為文件

?

轉載于:https://www.cnblogs.com/qubaba/p/10843201.html

總結

以上是生活随笔為你收集整理的Spring Cloud Config git版的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。