IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

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

    testcs_dn发表于 2015-05-08 18:46:49
    love 0

    执行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>


沪ICP备19023445号-2号
友情链接