I have been working on that for some time now but just can’t get it to work. I created a minimal sample to simplify talking about it.
This seems to work, but really doesn’t (because IDEA still sees servlet-api-2.5 in the module classpath but gradlew test passes for reasons that are not clear to me)
This one does not work:
I just can’t figure out why the second example behaves different from the first one. The output from build.gradle seems to be correct (does not show servlet-api-2.5) but running it shows something different. Classes still seem to be loaded from from the old version 2.5 (see output of the corresponding unit test).
I’m at a loss here, especially as I haven’t found any way to debug Gradle build scripts from IDEA. This is a serious problem for me as gradleApi() exports a huge amount of JAR files to the class path.