Groovy Cookbook

How to remove any class annotation with Groovy compiler configuration script?

One of the most interesting Groovy features is its ability to configure advanced compiler[1] options using DSL script. It becomes handy when you want to apply some global modifications to all Groovy classes. (For instance, you want to add @CompileStatic annotation to all classes, without applying changes to the source code). In most cases, you want to add something to the existing source code, e.g., classes imports or useful annotations, but what if we want to remove one annotation or another?

Read more →