hamcrest-junit
hamcrest-junit copied to clipboard
Declare runtime dependency on JUnit and Hamcrest, not compile dependency
This makes dependency management in client code easier.
Yes, as it currently stands this project is pointless:
build.gradle
testCompile 'org.hamcrest:hamcrest-junit:2.0.0.0'
Nothing else.
gradle dependencies --configuration testCompile
testCompile - Classpath for compiling the test sources.
\--- org.hamcrest:hamcrest-junit:2.0.0.0
+--- junit:junit:4.12
| \--- org.hamcrest:hamcrest-core:1.3
\--- org.hamcrest:java-hamcrest:2.0.0.0
This makes things worse since java-hamcrest duplicates what's inside hamcrest-core.
You are not meant to use hamcrest-junit by itself. The intended use is to allow JUnit to be used with the latest versions of Hamcrest. So, in your project, depend on the latest JUnit excluding transitive dependencies on Hamcrest, and depend on Hamcrest JUnit.