小白熊与koala的问题二:koala项目添加excel读写功能 install时报错

小白熊 发布于 2014/01/18 18:17
阅读 482
收藏 0

已经建立好的koala项目,后修改infra 子项目,为infra 添加excel依赖的支持, 看见、excel、的jar包已经下载下来了。但是mvn install时出现以下错误,想知道为什么,谢谢

[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ zzb-infra ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ zzb-infra ---
[INFO] Compiling 2 source files to D:\work\javaee\opensource\koala\zzb\zzb-infra\target\test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ zzb-infra ---
[INFO] Surefire report directory: D:\work\javaee\opensource\koala\zzb\zzb-infra\target\surefire-reports


-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.openkoala.excel.sample.ExcelReaderTest
Tests run: 6, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.278 sec <<< FAILURE!
Running org.openkoala.excel.sample.ExcelWriterTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 sec <<< FAILURE!


Results :


Tests in error: 
  testReadColumnIndexRange(org.openkoala.excel.sample.ExcelReaderTest): java.io.IOException: Invalid header signature; read 0xE011BDBFEFBDBFEF, expected 0xE11AB1A1E011CFD0
  testReadColumnNameRange(org.openkoala.excel.sample.ExcelReaderTest): java.io.IOException: Invalid header signature; read 0xE011BDBFEFBDBFEF, expected 0xE11AB1A1E011CFD0
  testReadFixedRows(org.openkoala.excel.sample.ExcelReaderTest): java.io.IOException: Invalid header signature; read 0xE011BDBFEFBDBFEF, expected 0xE11AB1A1E011CFD0
  testWrongNumeric(org.openkoala.excel.sample.ExcelReaderTest): Unexpected exception, expected<java.lang.IllegalStateException> but was<java.lang.RuntimeException>
  testWrongBoolean(org.openkoala.excel.sample.ExcelReaderTest): Unexpected exception, expected<java.lang.IllegalStateException> but was<java.lang.RuntimeException>
  testWrongDate(org.openkoala.excel.sample.ExcelReaderTest): Unexpected exception, expected<java.lang.IllegalStateException> but was<java.lang.RuntimeException>
  testExportData(org.openkoala.excel.sample.ExcelWriterTest): java.io.IOException: Invalid header signature; read 0xE011BDBFEFBDBFEF, expected 0xE11AB1A1E011CFD0


Tests run: 7, Failures: 0, Errors: 7, Skipped: 0


[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] zzb ............................................... SUCCESS [0.528s]
[INFO] zzb-conf .......................................... SUCCESS [3.238s]
[INFO] zzb-infra ......................................... FAILURE [1.669s]
[INFO] zzb-core .......................................... SKIPPED
[INFO] zzb-application ................................... SKIPPED
[INFO] zzb-applicationImpl ............................... SKIPPED
[INFO] zzb-web ........................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.961s
[INFO] Finished at: Sat Jan 18 18:16:42 CST 2014
[INFO] Final Memory: 23M/165M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project zzb-infra: There are test failures.
[ERROR] 
[ERROR] Please refer to D:\work\javaee\opensource\koala\zzb\zzb-infra\target\surefire-reports for the individual test results.


加载中
0
唯风
唯风
ExcelReaderTest 测试类编译失败,你可以跳过 测试类编译,或者把测试类先拿掉就行了
0
小白熊
小白熊

引用来自“唯风”的答案

ExcelReaderTest 测试类编译失败,你可以跳过 测试类编译,或者把测试类先拿掉就行了

按照您的方法,install成功了。

每次编译前都拿掉测试类很不方便,我想通过在pom中加入加入以下语句 忽略测试,发现也能编译 通过。但是

<plugins>
       <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-surefire-plugin</artifactId>
       <configuration>
         <skip>true</skip>
       </configuration>
     </plugin>
        </plugins>

在 test-classes 的 xls 文件在编译拷贝过来的时候全部乱码了,这也是为什么?如图 :


返回顶部
顶部