My build fails under gradle 1.8 but exactly the same code and dependency chain pass in 1.7. The build fails on the compileTestJava task and analysing the debug log shows that the same jars are passed to the compiler but in a different order. The release notes say
The order of resolved artifacts and resolved files has changed. This change is transparent to the vast majority of builds.
The particular failure appears to be because junit 4.10 and hamcrest 1.3 both contain the class ‘org.hamcrest.CoreMatchers’ and the order has swapped around in 1.8 so that I am now picking up junit when before I was picking up hamcrest.
I have 2 questions;
- What strategies do I have to resolve this? Is it just a case of finding and excluding the offending dependency? * How does gradle now decide what order to list these in? How does this differ to 1.7?