本文转载自:
http://www.blogjava.net/wangzhouyu/archive/2011/06/30/353403.html
1.编译乱码,设置编译的字符集编码和环境编码
<plugin><groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.4</source>
<target>1.4</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
并设置环境变量MAVEN_OPTS=-Xms64m -Xmx128m -Dfile.encoding=UTF-8
<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>
本文转载自:
http://www.blogjava.net/wangzhouyu/archive/2011/06/30/353403.html