---
title: "maven编译报“编码 GBK 的不可映射字符”问题的解决"
author: "cetusz"
date: "2013-10-11T09:47:12Z"
tags: []
categories: ["研发管理"]
slug: "maven-gbk"
draft: false
lastmod: "2013-10-11T09:49:44Z"
id: 1954698
url: "https://cetus.iteye.com/blog/1954698"
---

今早上hudson构建测试版本，本地可以完美编译，传到构建服务器上就报“[“编码 GBK 的不可映射字符”](http://www.cnblogs.com/leipei2352/archive/2011/04/20/2022128.html)

上网搜了资料说要设置编码，设置如下，&lt;encoding&gt;UTF-8&lt;/encoding&gt;为解决问题关键

```
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
   <version>2.3.2</version>
   <configuration>
     <source>1.6</source>
     <target>1.6</target>
     <encoding>UTF-8</encoding>
   </configuration>
</plugin>
```