Gradle 1.8 results in a non working build, while same code works fine with Gradle 1.7

I have an application that is running a Restlet server with a Ebean connection to the database. When building this application with Gradle 1.7 and deploy it to production everything works fine. But when I try to build the same application with Gradle 1.8 it freezes with 100% CPU (on a NIO thread). The only difference between the working version and the non working version is that the working version is built with Gradle 1.7. First I thought it could have anything to do with any corrupt jar-file in the dependency cache for Gradle 1.8, but even when I have flushed the cache I get the same problem. Please, do anyone have a clue what can be causing this?

I just the jar task to build a fat jar. When I compare the files inside the jars I notice that the classes in javax\servlets is different. How can this happen?

This is likely this: http://www.gradle.org/docs/current/release-notes#the-order-of-resolved-files-and-artifacts-has-changed

You’ve likely got multiple jars providing the servlet classes. You should use excludes (or another mechanism) to ensure that you only get the version you want on the classpath.

I just the jar task to build a fat jar. When I compare the files inside the jars I notice that the classes in javax\servlets is different. How can this happen?

But why do I get different dependencies between different versions of Gradle?

Because of that ordering change I linked to.

If this is indeed the cause, It’s unfortunate that this change has bitten you so hard. However, this was a ticking time bomb as there are number of different potential changes that you could have made to your build config that would have made this surface. The only truly safe solution is to ensure you don’t have duplicate versions of these classes on the classpath at all.

You should consider managing duplicates for your fatjar…

task fatjar(type: Jar) {
   …
   duplicatesStrategy "fail"
}

http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy

Ok, then I see. Thank you for your help. I do not have any dependency to javax myself so it is probably some of my dependencies that depend on different version of it. I will try your trick to fail upon duplicates. Thanks.

No problem, good luck.