How To Solve Java Lang No Class Def Found Error Org Mockito Mockito

How To Solve Java Lang No Class Def Found Error Org Mockito Mockito

這篇介紹How To Solve Java Lang No Class Def Found Error Org Mockito Mockito。

process

1
2
3
4
5
6
7
8
9
10
11
12
13
The scope test indicates that the dependencies (binary files) 
are only used using maven's test phase.
They are not delivered with the final target jar though.
So if you run tests yourself (rather than letting maven do it),
you'd better leave the default runtime scope, as follows:

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>2.0.2-beta</version>
</dependency>

結論是將<scope>test</scope>拿掉即可解決!