Spring cloud配置没有';无法检测git uri

Spring cloud配置没有';无法检测git uri,spring,spring-cloud-config,Spring,Spring Cloud Config,如何引用资源目录(或相对于源文件的目录)作为配置服务器(在Windows上)的本地git uri 我试过file:///resources和file:///full/path/to/resources,这一切似乎都失败了 根据要求,以下是一些代码: ConfigServiceApplication.java @EnableConfigServer @SpringBootApplication public class ConfigServiceApplication { public

如何引用
资源
目录(或相对于源文件的目录)作为配置服务器(在Windows上)的本地git uri

我试过
file:///resources
file:///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

另请参见

我很不好意思写这篇文章,但intellij不会清理构建。我运行了gradle任务,一切都解决了。

也许可以显示一些代码。。不确定你的问题更新了我的问题。好吧,我理解你的问题,基本上你不能这样做,因为你没有.git目录,你需要一个真正的REPO,spring cloud不是在寻找配置文件,而是REPO!我已经用git init将目录设置为repo,并提交了文件。首先,您要做的是将其配置到另一个文件夹,例如
file://tmp/config-repo
,看看它是否有效。。我不确定它是否支持git子模块。。所以请先试试这个。。