Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven test results encoding

Tags:

maven

I run test by MVN clean test on my Mac, the console output looks like this:

 \u8F93\u5165\u6B63\u5E38\u53C2\u6570uid\u548Climit\uFF0C\u6570\u636E\u5E93\u65E0\u8BB0

Information:

Apache Maven 3.0.3 (r1075438; 2011-03-01 01:31:09+0800)
Maven home: /usr/local/apache-maven-3.0.3
Java version: 1.6.0_33, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.7.4", arch: "x86_64", family: "mac"

My test case is written in Chinese. How do I set the test results encoding?

Thanks

like image 825
user1536828 Avatar asked Dec 01 '25 02:12

user1536828


1 Answers

You have to set the following in your pom.xml:

<project>
  ...
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  ...
</project>

May be you have to enhance that by using the following:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
like image 58
khmarbaise Avatar answered Dec 05 '25 05:12

khmarbaise



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!