2017-08-03 32 views
0

當我使用maven的CLI時曾經有一個錯誤或異常我得到的運行JUnit測試我注意到是我該如何設置讓JUnit來顯示正確的錯誤或異常堆棧跟蹤

com.x.blah.testmyclass : tried to access method 
org.apache.maven.surefire.report.SimpleReportEntry.<init> 
    (Ljava/lang/String;Ljava/lang/String;Lorg/apache/maven/surefire/report/StackTraceWriter;)V from class 
org.apache.maven.surefire.common.junit4.JUnit4RunListener 

有沒有什麼辦法:

  1. 得到它打印出的實際測試引起的類內的故障
  2. 輸出拋出的原始異常

我不是很在Maven的經歷和在網上四處搜尋,卻什麼都看不到明顯,並已訴諸記錄在我的測試中他們失敗時它可以是非常耗時

+0

看起來他們用2.19做了一些改變 - 不確定是否相關。 http://maven.apache.org/surefire/maven-surefire-plugin/examples/logging.html –

+0

所以我做了這個改變,它更長的時間吐出上面的錯誤消息但仍然不會輸出實際的異常...有任何想法嗎? – jonnie

+0

沒關係,現在似乎是輸出。 @rafaelim如果你想添加你的評論作爲答案,我會很樂意接受 – jonnie

回答

1

檢查神火插件版本!

maven-surefire-plugin 2.10 has this SimpleReportEntry(String,StackTraceWriter)constructor,but in version 2.19 does not have it。