On the other hand mockito-core.jar is just Mockito classes (also with repackaged ASM and CGLIB). When using it with Maven or Gradle required dependencies (Hamcrest and Objenesis) are managed by those tools (downloaded automatically and put on a test classpath). It allows to override used versions (for example if our projects uses never, but backward compatible version), but what is more important those dependencies are not hidden inside mockito-all.jar what allows to detected possible version incompatibility with dependency analyze tools. This is much better solution when dependency managed tool is used in a project.
Top 10 Java library across all libraries, not only the testing tools.In late 2013 there was an analysismade of 30.000 GitHub projects.Although Mockito reached number 9 in the main report, mockito-core and mockito-all are the same tooland therefore the factual position of Mockito is number 4, surpassing famous tools like Guava or Spring.Treat this study as an indicator of a big impact that Mockito makes every day on unit tests written in Java.
Luckily for us, Mockito allows to us to use a mockito-core dependency instead of mockito-all. Running a dependency check (with dependency:tree or online) shows us it depends on hamcrest-core.
760c119bf3