Maven打包是提示GBK编码不支持的问题

aven 2.0.9版本,JDK 1.5.012,Eclipse 3.4版本,在使用maven打包时,经常会报GBK编码不支持,重新clean一下项目,然后再maven clean一下,基本上都能解决这个问题,但这个总归不是一个彻底的解决办法,最后查了一下maven,终于找到解决办法:

Pom.xml中配置了编译插件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<plugin>
 
<artifactId>maven-compiler-plugin</artifactId>
 
<version>2.0.2</version>
 
<configuration>
 
<source>1.5</source>
 
<target>1.5</target>
 
</configuration>
 
</plugin>
cbf4life 标签: MAVEN

解决办法:

修改pom.xml文件,强制使用utf8的编码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<plugin>
 
<artifactId>maven-compiler-plugin</artifactId>
 
<version>2.0.2</version>
 
<configuration>
 
<source>1.5</source>
 
<target>1.5</target>
 
<encoding>utf8</encoding>
 
</configuration>
 
</plugin>
原文地址:https://www.cnblogs.com/chenying99/p/2559179.html