MAVEN编译时错误:编码GBK的不可映射字符

Windows下MAVEN编译含有中文的Java文件时出错:错误:编码GBK的不可映射字符。

更改pom.xml,在maven-compiler-plugin的配置里面加上<encoding>utf-8</encoding>:

 1             <plugin>
 2                 <groupId>org.apache.maven.plugins</groupId>
 3                 <artifactId>maven-compiler-plugin</artifactId>
 4                 <version>2.5.1</version>
 5                 <configuration>
 6                     <source>1.7</source>
 7                     <target>1.7</target>
 8                     <compilerArgument>-Xlint:all</compilerArgument>
 9                     <showWarnings>true</showWarnings>
10                     <encoding>utf-8</encoding>
11                     <showDeprecation>true</showDeprecation>
12                 </configuration>
13             </plugin>

 

posted on 2013-07-09 21:39  Richie Hao  阅读(2902)  评论(0)    收藏  举报

导航