zoukankan      html  css  js  c++  java
  • Maven 编译后 内存中中文数据乱码

    1.编译乱码,设置编译的字符集编码和环境编码 
    <plugin> 
            <groupId>org.apache.maven.plugins</groupId> 
            <artifactId>maven-compiler-plugin</artifactId> 
            <version>2.3.2</version> 
            <configuration> 
                    <source>1.7</source> 
                    <target>1.7</target> 
                    <encoding>UTF-8</encoding>
     
            </configuration> 
    </plugin> 
    设置环境变量MAVEN_OPTS=-Xms128m -Xmx512m -Dfile.encoding=UTF-8 

    2.运行mvn test时乱码(IDE上运行TestCase时OK,但是运行maven 
    test乱码,结果测试不通过)修改pom.xml增加如下内容即可 
    <plugin> 
            <groupId>org.apache.maven.plugins</groupId> 
            <artifactId>maven-surefire-plugin</artifactId> 
            <version>2.7.2</version> 
            <configuration> 
                    <forkMode>once</forkMode> 
                    <argLine>-Dfile.encoding=UTF-8</argLine>
     
                    <systemProperties> 
                            <property> 
                                    <name>net.sourceforge.cobertura.datafile</name> 
                                    <value>target/cobertura/cobertura.ser</value> 
                            </property> 
                    </systemProperties> 
            </configuration> 

    </plugin> 


    http://budairenqin.iteye.com/blog/1336314

  • 相关阅读:
    Struts2笔记——ONGL表达式语言
    Struts2笔记——自定义拦截器
    Struts2笔记——Action校验器
    Struts2笔记——文件上传
    Struts2笔记——与ServletAPI解耦
    Struts2笔记——通配符和动态方法调用
    Struts2笔记——类型转换
    Struts2笔记——result结果类型
    MongoDB相关资料
    公开数据集
  • 原文地址:https://www.cnblogs.com/silyvin/p/9106843.html
Copyright © 2011-2022 走看看