Gradle: First Build
Maven describes a project with a fixed model and a fixed lifecycle. Gradle starts from a different idea: a build is a graph of tasks, each with declared inputs and outputs, and build scripts are code that configures that graph. Plugins (java, application, maven-publish) add tasks and conventions, so for an ordinary Java project the script stays as short as a POM. The payoff of the task model is speed: Gradle knows exactly what each task read and wrote, so it can skip, cache and parallelise work.
Generating a project
gradle init creates a ready-made build. The options make it non-interactive:
bash · try it yourself
mkdir demo && cd demo
gradle init --type java-application --dsl kotlin --test-framework junit-jupiter --package demo \
--project-name demo --no-split-project --java-version 21 --no-incubating -q
find . -type f -not -path './.gradle/*' | sort
cat settings.gradle.kts | grep -v -E '^ ?\*|^/\*|^