我正在尝试设置spring cloud配置服务器
本地F:\ -Created - local - repository \repository上的git git存储库文件夹
使用我的服务的类路径链接源-Added属性文件对其进行-linked
存储库将我的更改提交到位置F:\git- -After -repository\repository
-hitting url:http://localhost:8888/limits/default
导致错误: org.springframework.cloud.config.server.environment.NoSuchLabelException:没有这样的标签: master
原因:无法解析org.eclipse.jgit.api.errors.RefNotFoundException:引用主文件
下面是我的spring boot应用程序的主要类
@EnableConfigServer
@SpringBootApplication
public class SpringCloudConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(SpringCloudConfigServerApplication.class, args);
}
}
application.properties
spring.application.name=spring-cloud-config-server
server.port=8888
spring.cloud.config.server.git.uri=file:////F:/git-local-
repository/repository预期结果:将显示应用程序属性详细信息和其他url
发布于 2019-07-31 16:33:40
问题出在额外的正斜杠。请更改为:
spring.cloud.config.server.git.uri=file:///F:/git-local-
repository/repository发布于 2019-07-31 15:54:50
如果您使用本地目录进行配置。
而不是
spring.cloud.config.server.git.uri=file:////F:/git-local-repository/repository使用
spring.cloud.config.server.native.search-locations=file:////F:/git-local-repository/repository发布于 2019-07-31 18:52:48
添加具有以下配置的bootstrap.yml文件对我有效。
spring:
application:
name: spring-cloud-config-server
profiles:
active: composite
cloud:
config:
server:
composite:
- type: native
search-locations: file:////F:/git-local-repository/repository
bootstrap: true
server:
port: 8888
endpoints:
restart:
enabled: truehttps://stackoverflow.com/questions/57257587
复制相似问题