Rely on:

        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
        </dependency>
Copy the code

Yaml configuration:

Spring: cloud: config: service-addr: 127.0.0.1:8848 file-extension: yaml namespace: XXX group: DEFAULT_GROUPCopy the code

dataId = applicationName+.yaml

Reading configuration

@Value(${nacos中dataId对应yaml的key})