Config服务端连接Git配置的方法
发布时间:2021-11-12 10:28 所属栏目:13 来源:互联网
导读:Config:服务端连接Git配置,代码如下所示: 1、导入依赖 dependencies dependency groupIdorg.springframework.boot/groupId artifactIdspring-boot-starter-web/artifactId /dependency dependency groupIdorg.springframework.boot/groupId artifactIdsprin
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); } (编辑:ASP站长网) |
相关内容
网友评论
推荐文章
热点阅读