Compilation bug with Gradle building Groovy project. java.lang.NoClassDefFoundError: Unable to load class groovy.servlet.ServletCategory

Compilation bug with Gradle. Unable to build a Groovy project.

General error during instruction selection: java.lang.NoClassDefFoundError: Unable to load class groovy.servlet.ServletCategory due to missing dependency javax/servlet/jsp/PageContext

java.lang.RuntimeException: java.lang.NoClassDefFoundError: Unable to load class groovy.servlet.ServletCategory due to missing dependency javax/servlet/jsp/PageContext

Very simple sample project here: https://jira.codehaus.org/browse/GROOVY-7070

Discussion here: https://groups.google.com/forum/#!msg/gradle-dev/D6Xy1KrX5Hc/v0gD_jdEidUJ

Raised GRADLE-3235