我的 Eclipse 是 Indigo Java 经典。
我有一个 java 项目,它有 mockito-all 作为依赖项。pom.xml:
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.8.5</version>
<scope>test</scope>
</dependency>
运行mvn clean install
,一切正常。然后我确实mvn eclipse:eclipse
解决了 Eclipse 中的所有依赖项。
当我尝试在 Eclipse 中运行 Junit 时,它没有运行并给我这个错误:
'Launching YourTest' has encountered a problem.
The archive: /home/shengjie/.m2/repository/org/mockito/mockito-all/1.9.5.jar which is referenced by the classpath, does not exist.
我的项目 pom.xml 声称它依赖于 mockito-all 1.8.5,我不确定 1.9.5 引用来自哪里。有任何想法吗?
==编辑==
$ mvn dependency:tree | grep mockito
[INFO] +- org.mockito:mockito-all:jar:1.8.5:test
[INFO] \- org.powermock:powermock-api-mockito:jar:1.4.12:test
[INFO] \- org.powermock:powermock-api-mockito:jar:1.4.12:test
[INFO] +- org.mockito:mockito-all:jar:1.8.5:test (version managed from 1.9.0)
[INFO] | +- org.mockito:mockito-all:jar:1.8.5:test (version managed from 1.9.5; scope managed from compile)
[INFO] | +- org.mockito:mockito-all:jar:1.8.5:test (version managed from 1.9.5; scope managed from compile)
[INFO] \- org.powermock:powermock-api-mockito:jar:1.4.12:test
[INFO] +- org.mockito:mockito-all:jar:1.8.5:test
[INFO] +- org.powermock:powermock-api-mockito:jar:1.4.12:test
[INFO] | +- org.mockito:mockito-all:jar:1.8.5:test (version managed from 1.9.5; scope managed from compile)