• 编码GBK的不可映射字符


    1、错误描述

    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[14,12] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[15,6] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[19,12] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[19,17] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[19,19] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[19,22] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[20,12] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[30,16] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[30,39] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[31,16] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[31,21] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[31,23] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[31,26] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[32,14] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[36,16] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[6,24] 程序包org.junit.runner不存在
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[7,40] 程序包org.springframework.test.context不存在
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[8,47] 程序包org.springframework.test.context.junit4不存在
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[9,52] 程序包org.springframework.test.context.transaction不存在
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[10,50] 程序包org.springframework.transaction.annotation不存在
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[22,2] 找不到符号
      符号: 类 RunWith
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[23,2] 找不到符号
      符号: 类 ContextConfiguration
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[24,2] 找不到符号
      符号: 类 Transactional
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[25,2] 找不到符号
      符号: 类 TransactionConfiguration
    [INFO] 24 errors 
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 2.486 s
    [INFO] Finished at: 2016-01-12T17:59:17+08:00
    [INFO] Final Memory: 11M/171M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project huxs: Compilation failure: Compilation failure:
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[14,12] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[15,6] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[19,12] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[19,17] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[19,19] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[19,22] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[20,12] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[30,16] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[30,39] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[31,16] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[31,21] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[31,23] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[31,26] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[32,14] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[36,16] 编码GBK的不可映射字符
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[6,24] 程序包org.junit.runner不存在
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[7,40] 程序包org.springframework.test.context不存在
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[8,47] 程序包org.springframework.test.context.junit4不存在
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[9,52] 程序包org.springframework.test.context.transaction不存在
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[10,50] 程序包org.springframework.transaction.annotation不存在
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[22,2] 找不到符号
    [ERROR] 符号: 类 RunWith
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[23,2] 找不到符号
    [ERROR] 符号: 类 ContextConfiguration
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[24,2] 找不到符号
    [ERROR] 符号: 类 Transactional
    [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[25,2] 找不到符号
    [ERROR] 符号: 类 TransactionConfiguration
    [ERROR] -> [Help 1]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
    

    2、错误原因

         由于将项目从SVN上检出的编码格式是UTF-8,Maven编译时使用的是GBK编码,两个编码不一致导出出错


    3、解决办法

         在pom.xml中添加编码格式:

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


  • 相关阅读:
    由大见小,从治国看企业管理,宜王霸之道
    止语
    VSTS团队浏览器文档相关
    《宇宙浪子》荐
    从《心物一元》到《神无方易无体》
    [导入][Tricks]在线字体测试
    [导入][Internet]Cheat Sheet: Web 2.0
    [导入][Code]Asp.net CSS问题
    一个JSON 实例 jQuery 解析JSON数据
    JQuery ajax 返回值如何进行赋值
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13314265.html
Copyright © 2020-2023  润新知