Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!

来源:互联网 发布:js value 编辑:程序博客网 时间:2024/05/21 17:23

执行Maven Install打包的时候,提示以下警告信息:
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!

解决方法:
打开项目属性》Resources,按下图修改。
这里写图片描述

保存后重新执行Maven Install 发现警告依然存在,原来是理解错误错误了,应该修改Maven的配置文件中关于编码的配置<encoding>utf-8</encoding>
完整示例:

            <plugin>                <groupId>org.apache.maven.plugins</groupId>                <artifactId>maven-compiler-plugin</artifactId>                <version>3.0</version>                <configuration>                    <encoding>utf-8</encoding>                    <source>1.8</source>                    <target>1.8</target>                </configuration>            </plugin>

还是存在警告,原来是需要在<project>中添加<properties>标签:

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