本文翻译自:How to configure encoding in Maven?
When I run maven install
on my multi module maven project I always get the following output: 当我在我的多模块maven项目上运行maven install
,我总是得到以下输出:
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
So, I googled around a bit, but all I can find is that I have to add: 所以,我google了一下,但我能找到的是我必须添加:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
...to my pom.xml. ...到我的pom.xml。 But it's already there (in the parent pom.xml
). 但它已经存在(在父pom.xml
)。
Configuring <encoding>
for the maven-resources-plugin or the maven-compiler-plugin also doesn't fix it. 为maven-resources-plugin或maven-compiler-plugin配置<encoding>
也无法修复它。
So what's the problem? 所以有什么问题?
#1楼
参考:https://stackoom.com/question/Cf2V/如何在Maven中配置编码
#2楼
This would be in addition to previous, if someone meets a problem with scandic letters that isn't solved with the solution above. 如果有人遇到上述解决方案无法解决的scandic字母问题,那么这将是以前的补充。
If the java source files contain scandic letters they n