【问题标题】:after package with maven, there is no jar generated in Idea.the error is: File encoding has not been set用maven打包后,Idea中没有生成jar,报错:File encoding has not been set
【发布时间】:2021-11-08 20:40:26
【问题描述】:

用maven打包后,Idea中没有生成jar,报错:File encoding has not been set, using platform encoding UTF-8,即build is platformdependent。

[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @  
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

使用平台编码(实际上是 UTF-8)来复制过滤的资源,即构建依赖于平台!

【问题讨论】:

标签: java maven


【解决方案1】:

您可以将编码添加到您的 pom.xml 文件中

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

【讨论】:

    【解决方案2】:

    打开这个设置,问题就解决了:显示排除的文件。 实际上,罐子是生成的,但它只是没有显示在想法上。

    【讨论】:

    • 我自己修好了
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-05-04
    • 2018-09-22
    • 2019-04-25
    • 1970-01-01
    • 1970-01-01
    • 2020-01-10
    • 2014-09-06
    相关资源
    最近更新 更多