我也配置了maven surefire-report-plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.17</version>
<configuration>
<outputDirectory>${myPath}</outputDirectory>
<outputEncoding>UTF-8</outputEncoding>
</configuration>
<executions>
<execution>
<id>create-surefire-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
以下是Maven-surefire-plugin的配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
</configuration>
</plugin>
我该如何解决这个问题?在这种配置中应该改变什么?
谢谢!
答案 0 :(得分:0)
<outputEncoding>UTF-8</outputEncoding>
<configuration>
与<reporting>
代码相同,定义<properties>
outputEncoding
就像这样
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<reporting>
<plugins>
<plugin>
...
</plugin>
</plugins>
</reporting>
注意:这适用于Maven 2.x
&amp; Maven 3.x
。