1.在 IDEA 中:
- 打开 File -> Settings -> Editor -> File Encodings
- 设置 "Global Encoding" 为 "UTF-8"
- 设置 "Project Encoding" 为 "UTF-8"
- 设置 "Properties Files" 的 "Default encoding for properties files" 为 "UTF-8"
- 勾选 "Transparent native-to-ascii conversion"
- 点击 "Apply" 和 "OK"
2.对于每个 YAML 文件:
- 在 IDEA 中右键点击文件
- 选择 "File Encodings"
- 选择 "UTF-8"
- 确保 "BOM" 选项是未选中的
3.在 IDEA 的运行配置中:
- 编辑运行配置
- 在 "VM options" 中添加:
text
-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8
4.清理项目
mvn clean
5.清理缓存并重新启动