美文网首页
[Maven]File encoding has not bee

[Maven]File encoding has not bee

作者: 余名 | 来源:发表于2020-09-23 18:36 被阅读0次

编译字符编码警告

问题

运行 mvn compile
控制台输出

[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!

处理方法

pom.xml 文件中添加 properties 标签

<project>
  ...
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  ...
</project>

相关文章

网友评论

      本文标题:[Maven]File encoding has not bee

      本文链接:https://www.haomeiwen.com/subject/afioyktx.html