LinuxCommandLibrary

gradle-tasks

TLDR

List the main tasks

$ gradle tasks
copy

List all tasks including subtasks
$ gradle tasks --all
copy

List tasks in a specific group
$ gradle tasks --group [group_name]
copy

List tasks for a specific subproject
$ gradle :[subproject]:tasks
copy

SYNOPSIS

gradle tasks [--all] [--group <group>] [--no-groups] [--no-search-upward] [--standard Gradle options]

PARAMETERS

--all
    Display all tasks, including undocumented ones without descriptions

--group <group>
    Show tasks only from the specified group (e.g., build, verification)

--no-groups
    List tasks without grouping by category

--no-search-upward
    Do not search parent directories for gradlew wrapper

-P <property=value>
    Pass system properties to the build

--help
    Show help for the tasks command

--version
    Print Gradle version

DESCRIPTION

The gradle tasks command (often invoked as gradle-tasks in some wrappers or aliases) displays all available tasks defined in a Gradle project's build.gradle script. Tasks are grouped by categories like build, verification, documentation, and help, with brief descriptions shown for each.

This command is essential for developers to explore project capabilities without parsing scripts manually. By default, it lists only tasks with descriptions, hiding internal or undocumented ones. Output includes task names, paths (for multi-project builds), and types.

Ideal for onboarding, debugging builds, or recalling task names. Run from project root or using Gradle wrapper (./gradlew tasks). Supports multi-project hierarchies, scanning subprojects unless disabled.

CAVEATS

Requires Java JDK (version per Gradle compatibility matrix) and Gradle installed. No man page (gradle help instead). Output depends on project build.gradle; empty projects show minimal tasks. Slow on large monorepos.

EXAMPLE USAGE

gradle tasks --all
Shows full task list.

./gradlew tasks --group=verification
Lists verification tasks only.

OUTPUT EXAMPLE

> Task name: clean
Deletes build directory.
> Task group: build

HISTORY

Introduced in Gradle 0.3 (2007) by Hans Dockter. Evolved with multi-project support in 0.9 (2008), task groups in 1.0 (2012). Current in Gradle 8.x with improved filtering.

SEE ALSO

gradle(1), mvn(1), make(1), ant(1)

Copied to clipboard