My Eclipse is Indigo Java classic.
I have a java project which has mockito-all as a dependency. pom.xml:
<dependency> <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> <version>1.8.5</version> <scope>test</scope> </dependency>
run mvn clean install
, everything is ok. Then I did mvn eclipse:eclipse
to resolve all the dependencies in Eclipse.
when I try to run a Junit in eclipse, it doesn't run and gives me this error:
'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.
My project pom.xml claims it's depending on mockito-all 1.8.5, I am not sure where the 1.9.5 reference is coming from. Any ideas?
==EDIT==
$ 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)
Under Run/Run (or Run/Debug) then under Classpath, there was a blank entry, (which made it quite well hidden) under User Entries. I managed to highlight User Entries, pressed the down arrow and highlighted this empty entry. Clicked Remove, and voila - the error was gone.
I had a similar problem while I was trying to start my tomcat. I would suggest that you check "Classpath" the following way:
1) Run Configurations
2) Project classpath
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With