2013-10-07 104 views
0

我想在springfuse(JavaEE 6 + Spring Framework(以Jetty爲目標)的幫助下構建我的webapps工作空間, Tomcat,JBoss等))和maven,到目前爲止我設法使用maven創建項目並將其導入到eclipse中,但是當我嘗試執行maven-install時,出現了幾個錯誤,最後出現了BUILD FAILURE通知。 我有JDK 7u9和Eclipse JUNO,這是錯誤我得到:無法執行目標org.apache.maven.plugins:maven-failsafe-plugin:2.12:驗證(驗證)

Running ir.raysis.isirep.repository.UsersRepositoryIT 
WARN o.h.s.i.ConfigContext.getLuceneMatchVersion HSEARCH000075: Configuration setting hibernate.search.lucene_version was not specified, using LUCENE_CURRENT. 
WARN i.r.i.d.IdentifiableHashBuilder.hash DEVELOPER: hashCode is not safe.If you encounter this message you should take the time to carefuly review the equals/hashCode methods for: ir.raysis.isirep.domain.Users You may consider using a business key. 
Hibernate: 
    select 
     nextval ('hibernate_sequence') 
WARN o.h.e.j.s.SqlExceptionHelper.logExceptions SQL Error: 90036, SQLState: 90036 
ERROR o.h.e.j.s.SqlExceptionHelper.logExceptions Sequence "HIBERNATE_SEQUENCE" not found; SQL statement: 
select nextval ('hibernate_sequence') [90036-171] 
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 8.679 sec <<< FAILURE! 
Running ir.raysis.isirep.util.IntegrationSampleIT 
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec 

Results : 

Tests in error: 
    saveAndGet(ir.raysis.isirep.repository.UsersRepositoryIT): org.hibernate.exception.GenericJDBCException: could not extract ResultSet 

Tests run: 2, Failures: 0, Errors: 1, Skipped: 0 

[INFO] 
[INFO] --- jetty-maven-plugin:8.1.10.v20130312:stop (stop-jetty) @ isirep --- 
[INFO] 
[INFO] --- maven-failsafe-plugin:2.12:verify (verify) @ isirep --- 
[INFO] Failsafe report directory: /home/moien/isirep/target/failsafe-reports 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 58.147s 
[INFO] Finished at: Mon Oct 07 17:25:11 IRST 2013 
[INFO] Final Memory: 40M/369M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.12:verify (verify) on project isirep: There are test failures. 
[ERROR] 
[ERROR] Please refer to /home/moien/isirep/target/failsafe-reports for the individual test results. 
[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. 

如何解決它的任何幫助將不勝感激。謝謝

回答

1

構建失敗,因爲你的測試(UsersRepositoryIT.saveAndGet)失敗。

原因:

ERROR o.h.e.j.s.SqlExceptionHelper.logExceptions 
    Sequence "HIBERNATE_SEQUENCE" not found; SQL statement: 
    select nextval ('hibernate_sequence') [90036-171] 
+0

我知道,但我不知道爲什麼測試失敗,我應該治好嗎!它或它不重要 – MoienGK

+0

也許應該有一些分貝,它現在不在! – MoienGK

+0

當你已經知道這一點的時候,你應該知道一個知道測試和/或構建腳本的腳本給你一個更有幫助的答案。 – Ralph

3

當您運行 「MVN安裝/測試/驗證」 Maven的故障保護,插件執行。如果您的目標只是獲取可部署到應用程序服務器的WAR文件,則可以執行以下操作之一。

  1. 運行「mvn package」,所以測試不運行。
  2. 運行「mvn install -DskipTests = true」。這將跳過運行測試。

但是,如果這是驗證您的Web應用程序的基本測試,則需要確定測試失敗並修復它的原因。你可以嘗試「mvnDebug」,如果你需要放一個斷點來調試。