ClassCastException: Gradle treets Groovy GStringImpl as Java String

There is a nice little tutorial on Groovy at resp. This worked with an Gradle 1.1, but now runs into a ClassCastException. I cannot figure out why I think it is due to this projects dynamic task definition based on a rule pattern…

java.lang.ClassCastException: org.codehaus.groovy.runtime.GStringImpl cannot be cast to java.lang.St
        at org.gradle.api.tasks.util.PatternSet.getAsSpec(
        at org.gradle.api.tasks.util.PatternSet$IntersectionPatternSet.getAsSpec(
        at org.gradle.api.internal.file.collections.DirectoryFileTree.visit(

Hello Carlo, Thanks for reporting, you’re running into a known issue: (GRADLE-2566). We already fixed this on master.

cheers, René