maven test中文乱码

论坛 期权论坛 脚本     
匿名技术用户   2021-1-3 23:38   34   0

用 eclipse-->run as --> maven test 就出现中文乱码

解决方法一:

<properties>
 <argLine>-Dfile.encoding=UTF-8</argLine>
</properties>

解决方法二:

 <build>
  <plugins>
   <!-- 解决maven test命令时console出现中文乱码乱码 -->
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.7.2</version>
    <configuration>
     <forkMode>once</forkMode>
      <argLine>-Dfile.encoding=UTF-8</argLine> 
<!--      <systemProperties> -->
<!--       <property> -->
<!--        <name>net.sourceforge.cobertura.datafile</name> -->
<!--        <value>target/cobertura/cobertura.ser</value> -->
<!--       </property> -->
<!--      </systemProperties> -->
    </configuration>
   </plugin>
  </plugins>
 </build>

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP