jettyRun, WAR has dependency on groovy, NoClassDefFoundError


(Jeremy) #1

My WAR compiles and executes .groovy scripts at runtime…

dependencies { compile “org.codehaus.groovy:groovy-all:2.4.7” }

This works great when I deploy the WAR to tomcat (for example). But it fails under jettyRun because Gradle has already initialized GroovySystem to the version it is using internally, which is different from the version I specify, and the ClassLoader jettyRun uses is apparently not isolating things as well as I would expect it to…

java.lang.NoClassDefFoundError: Could not initialize class groovy.lang.GroovySystem

JettyRun.classpath does not seem to be the answer. I’ve examined it: it points at the correct groovy-all JAR and does not contain anything that points to the Gradle runtime groovy JAR.

Any suggestions?
Thanks!