Groovy static compilation overview

GROOVY_STATIC_COMPILATION defines how Groovy scripts are compiled and executed in the system. It helps to control whether scripts are compiled statically (checked before running) or dynamically (checked while running).

When set to true, it enforces static compilation at system start up and whenever scripts are created or updated, ensuring that scripts are checked for security and correctness before they run. If set to false, this warn users if static compilation fails in the script editor, but it will still allow the script to be saved and executed using dynamic compilation.

If the parameter is left empty or set to null, this will attempt static compilation first and fall back to dynamic compilation if it fails, allowing both static and dynamic scripts to coexist.

Static sandboxing checks scripts against a whitelist during compilation, making it more secure and efficient, while dynamic sandboxing performs these checks at runtime. The @CompileStatic annotation is allowed in your IDE during development, but must not be used in the system because it bypasses sandbox security.