windows下maven打包eclipse工程

打包过程中,可能出现的2个问题:

①、[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!

解决办法:

只要在pom.xml文件中增加一个配置项即可

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>


②、编码 gbk 的不可映射字符

解决办法:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.1</version>
    <configuration>
        <source>1.6</source>
        <target>1.6</target>
        <encoding>utf8</encoding> 
    </configuration>
</plugin>


参考:

http://blog.csdn.net/crazycoder2010/article/details/7077233

http://capslk.iteye.com/blog/1419958

posted @ 2013-10-11 10:37  奋斗中的毛毛虫  Views(282)  Comments(0Edit  收藏  举报