If you are using the git profile, you need to set a Git URI in your configuration. If you are using a native profile and have spring.cloud.config.server.bootstrap=true, you need to use a composite configuration
时间: 2023-12-03 20:43:41 浏览: 401
git-multi-profile:轻松自动为多个git帐户使用正确的SSH密钥和用户配置文件
It seems like you are talking about configuring a Spring Cloud Config Server for your application.
If you are using the git profile, you should set the Git URI in your configuration file. For example, you can add the following to your `application.yml` file:
```yaml
spring:
cloud:
config:
server:
git:
uri: <your-git-repo-uri>
```
On the other hand, if you are using a native profile and have `spring.cloud.config.server.bootstrap=true`, you need to use a composite configuration. This means that you need to specify the location of your local configuration files as well as the location of your Git repository. Here's an example:
```yaml
spring:
profiles:
active: native
cloud:
config:
server:
native:
search-locations: classpath:/config/
bootstrap: true
composite:
- type: native
search-locations: classpath:/config/
- type: git
uri: <your-git-repo-uri>
```
In this example, the `native` profile is active, so the server will look for configuration files in the `classpath:/config/` directory. At the same time, the server is configured to use a composite configuration, which includes both the local configuration files and the Git repository specified by the `uri`.
阅读全文