2014-11-06 32 views
0

我真的想经营我的SBT项目的基础上TestNG的,但是当我运行它,我得到错误SBT不能老是找com.google.inject

错误:scalac:加载时出错ITestContext,类文件'〜.ivy2 \ cache \ org.testng \ testng \ jars \ testng-6.8.jar(org/testng/ITestContext.class)'is broken (class java.lang.NullPointerException/null) Warning:scalac:Class com未找到.google.inject.Module - 继续存根。

我没有看到的依赖树com.google.inject不知道,如何手动

+0

SBT版本是0.13.6 – 2014-11-22 08:53:31

回答

0

添加:

libraryDependencies ++= { 
    "com.google.inject" % "guice" % "3+", 
    "org.glassfish.hk2" % "custom-resolver-example" % "2+", 
} 

解决了问题,但我真的不知道,这是很好的解决方案。

0

您正在使用什么版本的SBT的增加吗?我在使用SBT版本0.13.1时遇到了同样的问题。升级到0.13.5或0.13.6解决了我的NullPointerException。

至于

[warn] Class com.google.inject.Module not found - continuing with a stub.

我仍不能肯定这是为什么此起彼伏。对于我自己来说,它对我的​​测试类和我的主类都运行了7次,但并不妨碍功能。