spring-cloud读取Nacos上的配置

报错信息

java 复制代码
20:06:44.599 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter -- 

***************************
APPLICATION FAILED TO START
***************************

Description:

Config data resource 'file [nacos:service-order.properties]' via location 'nacos:service-order.properties' does not exist

Action:

Check that the value 'nacos:service-order.properties' at class path resource [application.properties] - 12:22 is correct, or prefix it with 'optional:'


Process finished with exit code 1

因为没有在依赖中加入如下config个依赖信息:

XML 复制代码
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
        </dependency>

加入如上依赖,刷新pom.

相关推荐
芒克芒克1 天前
深入浅出JVM的运行时数据区
java·开发语言·jvm·面试
毕设源码-赖学姐1 天前
【开题答辩全过程】以 影视资源分享论坛为例,包含答辩的问题和答案
java
沉默-_-1 天前
从小程序前端到Spring后端:新手上路必须理清的核心概念图
java·前端·后端·spring·微信小程序
xrkhy1 天前
多线程,高并发、物联网以及spring架构的面试题-->周
java·spring·架构
jgyzl1 天前
2025.12.21 学习web前必要知识点梳理
java·hash
齐 飞1 天前
Spring Cloud Alibaba快速入门-分布式事务Seata(下)
分布式·spring cloud·微服务
a程序小傲1 天前
中国邮政Java面试被问:gRPC的HTTP/2流控制和消息分帧
java·开发语言·后端
forestsea1 天前
Springboot 4.0十字路口:虚拟线程时代,WebFlux与WebMVC的终极选择
java·后端·spring
Sylvia-girl1 天前
Java之构造方法
java·开发语言