Spring Cloud 配置未检测到 git uri

标签 spring spring-cloud-config

如何引用 resources 目录(或与我的源文件相关的目录)作为配置服务器的本地 git uri(在 Windows 上)?

我尝试过 file:///resourcesfile:///full/path/to/resources,似乎都失败了。

根据要求,这里有一些代码:

ConfigServiceApplication.java

@EnableConfigServer
@SpringBootApplication
public class ConfigServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConfigServiceApplication.class, args);
    }
}

应用程序属性

spring.cloud.config.server.git.uri=file:///full/path/to/resources
spring.application.name=config-service
server.port=8888

最佳答案

如果您想使用文件系统作为后端,只需尝试以下设置:

spring.profiles.active=native
spring.cloud.config.server.native.searchLocations: file:///full/path/to/resources

另请参阅this documentation

关于Spring Cloud 配置未检测到 git uri,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41161587/

相关文章:

netflix-eureka - Cloud config server 和 Eureka 有什么区别

java - spring中如何使用表单将数据从jsp发送到 Controller

java - 在使用 Spring Boot 进行集成测试期间使用测试数据填充数据库

java - Spring MVC 项目 - 读取 CSV 文件 - HTTP 状态 500 - data.csv(访问被拒绝)

java - 在没有 Git 存储库的情况下使用 Spring Cloud Config

offline-caching - Spring Cloud 配置和缓存

spring - 在环境变量中设置 spring.cloud.config.failFast

java - spring cloud config ssh 连接失败

java - 在 org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decolated 上找不到属性 'run'

java - 我可以用 jqGrid 实现延迟加载吗?