更新时间:2022-07-18 10:42:25
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
@EnableConfigServer
spring:
cloud:
config:
server:
git:
uri: https://github.com/jiaofanting/spring-cloud-config-repo/
server:
port: 8080
这个uri是我git目录放的一个application.yml 路径,打开是404,因为它不是一个有效的链接,它只是说明了 application.yml文件放在哪里。
The HTTP service has resources in the form:
/{application}/{profile}[/{label}]
/{application}-{profile}.yml
/{label}/{application}-{profile}.yml
/{application}-{profile}.properties
/{label}/{application}-{profile}.properties
where the "application" is injected as the spring.config.name in the SpringApplication (i.e. what is normally "application" in a regular Spring Boot app), "profile" is an active profile (or comma-separated list of properties), and "label" is an optional git label (**defaults to "master".**)
截图更清晰
注意中间有个- ,对照文档看效果