首页 文章

Gradle:依赖性未添加到类路径中

提问于
浏览
0

我在build.gradle文件中添加了以下依赖项 . Eclipse插件添加在build.gradle中 .

testCompile 'io.dropwizard:dropwizard-testing:1.2.0'

一旦我运行gradle eclipse命令,所有编译依赖项都会在类路径中添加,但是testcompile依赖项不会在类路径中添加 .

但是testCompile'io.dropwizard:dropwizard-testing:1.2.0'也有像mockito这样的传递依赖 . 因此,每当我尝试在我的Junit中使用mockito时,那些都没有被编译 .

我不确定io.dropwizard的传递依赖性是什么问题:dropwizard-testing:1.2.0可用

1 回答

  • 2

    看看dropwizard测试依赖项here我可以在测试范围的依赖项中查看't see mockito in the compile scoped dependencies. It',但是当jar包含在另一个项目中时's irrelevant, test scoped dependencies are private to that project and don' t成为传递依赖项 .

相关问题