Global AST transformation in Spock throws exception with meaningful error message if used with incompatible Groovy version (e.g. Spock for Groovy 2.5 executed with Groovy 2.4):
However, it stopped working with Spock 2.0 for Groovy 2.5 and Groovy 3.0:
It's not very constructive for people seeing that error message. Firstly, I suspected some incompatibilities in the Spock code which completely fails with new Groovy. However, it turned out that the exception is hidden by Groovy itself.
I slightly modified ASTTransformationVisitor it detect that situation and get target/cause in a case of InvocationTargetException - my PR.
It helped, however, I haven't found any change in the ASTTransformationVisitor which could cause that regression. It might to some 2.5→3.0 change how constructor are called (e.g. around CachedConstructor which is used, but doesn't seem to intercept the exception) or anything else. You might want to investigate it - it worked without my tweak in Groovy 2.5.
Related Spock issues: https://github.com/spockframework/spock/issues/1067