Groovy Scripting

Groovy scripting tutorials for automation, system administration, and rapid prototyping. Covers process execution, file manipulation, and command-line tools.

Groovy HTTP REST – Cookbook Guide with 10+ Examples

Groovy HTTP REST networking concise and readable. See 12 tested examples covering URL.text, HttpURLConnection, GET/POST/PUT/DELETE, JSON payloads, response headers, error handling, basic auth, and java.net.http.HttpClient. “The best API client is the one you don’t need a library for. Groovy’s URL enhancements turn HTTP calls into one-liners – add Java’s HttpClient when you need more muscle.” Roy Fielding, REST Dissertation Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Intermediate | Reading Time: 22 minutes Every application ... Read More

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 Execute Shell Command – Quick Recipes with 10+ Examples

Quick copy-paste recipes to groovy execute shell command calls from scripts. 12 tested examples covering one-liners, output capture, piping, cross-platform tricks, and common CLI tool invocations. “The best shell scripts are the ones you rewrite in a real language – and Groovy makes that rewrite shorter than the original script.” Brian Kernighan, Unix Philosophy Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Beginner-Intermediate | Reading Time: 16 minutes This is not a detailed guide on ... Read More