Skip to content

Instantly share code, notes, and snippets.

@ahhqcheng
Created September 25, 2013 03:26
Show Gist options
  • Save ahhqcheng/6694839 to your computer and use it in GitHub Desktop.
Save ahhqcheng/6694839 to your computer and use it in GitHub Desktop.
maven编译文件的编码设置
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<!--java编译-->
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<!-- 可以通过 <encoding>UTF-8</encoding> 来设置,如果不设置的话会用本地操作系统的编码来编译文件 -->
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<!--资源文件 -->
<artifactId>maven-resources-plugin</artifactId>
<version>2.3</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment