I was going to post this as a question, as I hit a problem with this, but perhaps just posting this as something to be aware of would be useful to some people.
One of my Gradle builds specifies a dependency on “groovy-all”, although I only do it to exclude a transitive dependency.
I had been working with version Gradle 2.3 for a while, and I had this dependency at version 2.3.9. I tried testing 2.4RC1, and I saw the following exception:
groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.3.10 and you are trying to load version 2.3.9
It didn’t take me long to figure out that I needed to change the version in my dependency to 2.3.10 so this could work with Gradle 2.4.
I also verified that if I specify version 2.3.10, then Gradle 2.3 fails with a similar (but reversed) error message.
This is not a big deal, but is it possible in my build script to determine the version of Groovy in use? For now, my best fix for this is just writing a comment before the dependency describing the situation, but I’m curious to know if I could just dynamically figure out the version of Groovy that Gradle is using.