Kv键值对:
K1: v1
集合:
K: {k1:v1,k2:v2,k3:v3}
或
K:
K1: v1
K2: v2
K3: v3
Array、list、queue:
K: [v1,v2,v3]
或
K:
- v1
- v2
- v3
Yml中单引号会将\n作为字符串输出、双引号会将\n作为换行输出
双引号不会转义、单引号会转义
Yml的编写自定义内容的提示
导入pom
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>2.1.1.RELEASE</version>
</dependency>
打包的时候排除,以免加载jvm的时候占用更多的内存和时长
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<excludes>
<exclude>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>