在 IntelliJ IDEA 中执行的 Maven Selenium WebDriver 项目中的编码警告

Encoding warning in Maven Selenium WebDriver project executing in IntelliJ IDEA

我在 IntelliJ IDEA 14.0.2 中有一个 Maven Selenium WebDriver 项目。我的 pom.xml 文件如下:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>MasteringSeleniumTestingTools</groupId>
    <artifactId>Chapter3</artifactId>
    <version>1.0-SNAPSHOT</version>
    <dependencies>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.45.0</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>

当我运行项目作为测试命令时,一些警告如下所示:

[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!<br>
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!

https://maven.apache.org/general.html#encoding-warning

<project>
  ...
  <properties>
         <project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
  </properties>

...

UTF-8 也是有效的。