Spring 云服务器不从本地文件系统读取

问题描述 投票:0回答:1

获取 URL http://localhost:8888/limits-service/default 的 Json 响应。它没有读取文件

limit-service.properties

{
    "name": "limits-service",
    "profiles": ["maximum"],
    "label": null,
    "version": null,
    "state": null,
    "propertySources": []
}

应用程序属性

spring.application.name = spring-cloud-confg-server
server.port = 8888
spring.profiles.active = native
spring.cloud.config.server.native.search-locations = file:///C:/Learning/configs-repo/

limit-service.properties(路径C:/Learning/configs-repo/)

limits-service.maximum = 8999
limits-service.minimum = 8

SpringCloudConfigServerApplication.java

@EnableConfigServer
@SpringBootApplication
public class SpringCloudConfigServerApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpringCloudConfigServerApplication.class, args);
    }
}

您能帮我理解为什么它不读取文件吗?

spring spring-boot rest
1个回答
1
投票

它不适用于 Spring boot 2.4.1 和 Spring Cloud 配置服务器 2020.0.0-M6。当我更改为 Spring boot 2.3.7.RELEASE 和 Spring cloud 配置服务器 Hoxton.SR9 时,它正在工作

© www.soinside.com 2019 - 2024. All rights reserved.