3. mockito-all

Of course, mockito-core has some dependencies like hamcrest and objenesis that Maven downloads separately, but mockito-all is an out-dated dependency that bundles Mockito as well as its required dependencies.

To verify this, let's look inside the mockito-all.jar to see the packages it contains:

mockito-all.jar
|-- org
| |-- hamcrest
| |-- mockito
| |-- objenesis

The latest GA version of mockito-all is a 1.x version released in 2014. Newer versions of Mockito don't release mockito-all anymore.

The maintainers released this dependency as a simplification. Developers were supposed to use this if they don't have a build tool with dependency management.

4. Conclusion

As we explored above, mockito-core is the main artifact of Mockito. Newer versions don't release mockito-all anymore. Henceforth, we should only use mockito-core.

Java bottom

I just announced the new Learn Spring course, focused on the fundamentals of Spring 5 and Spring Boot 2: