Groovy

Comprehensive Groovy programming tutorials, examples, and guides. Learn Groovy from beginner to advanced with tested code examples and real-world projects.

Groovy @Grab Annotation – Practical Recipes with 10+ Examples

Practical Groovy Grab annotation (@Grab) recipes for popular libraries. 12 copy-paste examples: Gson, Apache Commons CSV, OkHttp, JDBC drivers, Jsoup, and more – each with a working script you can run immediately. “The best dependency manager is the one you forget is there – until you need a library at 2 AM and it just downloads itself into your script.” Guillaume Laforge, Groovy Project Lead Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Beginner-Intermediate | ... Read More

Groovy Static vs Dynamic – CompileStatic Performance Guide with 10+ Examples

Groovy static compilation performance compared to dynamic Groovy and Java. 13 tested examples with benchmarks, migration strategies, and a guide to choosing static vs dynamic for each part of your codebase. “Dynamic typing lets you move fast. Static typing lets you move fast without breaking things. The trick is knowing which one you need right now.” Venkat Subramaniam, Programming Groovy 2 Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Intermediate-Advanced | Reading Time: 18 minutes ... Read More

Groovy TimeCategory and Date Manipulation – Cookbook with 10+ Examples

Groovy TimeCategory and date manipulation with 13 tested examples. Write 3.days.ago, 2.hours.from.now, and natural date arithmetic using Groovy’s built-in date DSL and GDK extensions. “There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors in date arithmetic.” Joshua Bloch, Effective Java Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Beginner-Intermediate | Reading Time: 18 minutes Our Groovy Date and Time post covers the java.time API – LocalDate, ZonedDateTime, Duration, ... Read More