2016-04-12 52 views
1

我在Eclipse Kepler中設置了我的Maven項目。 pom.xml文件依賴於TestNg 6.0.1。當我右鍵點擊我的項目時,它顯示選項「Run as TestNG」。但是,當我點擊它,Eclipse中顯示了一個錯誤:在Eclipse下運行TestNG時出錯「不支持TestNG版本」

Exception in thread "main" org.testng.TestNGException: 
6.0.1 is not a supported TestNG version 
    at org.testng.remote.support.ServiceLoaderHelper.getFirst(ServiceLoaderHelper.java:22) 
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:43) 

依賴於POM:

<dependency> 
    <groupId>org.testng</groupId> 
    <artifactId>testng</artifactId> 
    <version>6.0.1</version> 
</dependency> 

回答

4

使用最新版本的TestNG的在你的POM的依賴。

可能您的TestNG的Eclipse插件是最新的,而用作POM依賴項的TestNG版本太舊了。試用6.9.10

+0

6.9.11也可用 – juherr