File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent或控制台输出中文乱码
在idea中,使用maven构建项目时,控制台输出:
File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent
就算将setting中的file encodings修改成 UTF-8,还是无效
解决:
在pom.xml中,properties中新增project.build.sourceEncoding:
<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties>
踩过这个坑,还有下一个坑等着你,这一路就是给自己填坑,坑填多了,也就习惯了,直到这一路平坦了,也就无怨无悔了。