为什么修改? 中文操作系统编码为 GBK,Maven 安装后会使用系统默认编码,编译含有中文字符的 UTF-8 格式源码文件时就出现编码不匹配的问题
场景:使用 Maven 编译项目,虽然提示编译成功,但会有以下警告
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!