Testng results報告出現中文亂碼和更新maven出現報錯現象實戰解決
阿新 • • 發佈:2019-02-20
1、Testng results報告出現中文亂碼
解決方法:
1)、先確認eclipse 的workspace設定是否為utf-8;路徑:Windows-->Preferences-->Genereal-->Workspace-->Text file endcoding: other-->UTF-8,點選儲存。
2)、修改eclipse.ini 檔案,檔案末尾新增: -Dfile.encoding=UTF-8,儲存之後最後重新啟動eclipse,以確保eclipse.ini 修改生效。
2、更新Maven專案 update project出現報錯
使用-maven-surefire-plugin外掛
在pom.xml配置檔案中加入如下語句:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>