0Pricing
Groovy & Gradle: JVM Automation and Build Engineering · Lesson

Parallel Execution & Configuration

Configure Gradle for parallel task execution and understand its impact on build performance.

Parallel Builds: Speeding Things Up

Imagine you have several independent tasks that need to be done. If you do them one by one, it takes a long time. But what if you could do some of them at the same time?

This is the core idea behind parallel execution in Gradle. It allows Gradle to run multiple independent tasks simultaneously, which can significantly reduce your overall build time, especially for large projects or multi-project builds.

Activating Parallelism

Gradle's parallel execution is not enabled by default. You need to explicitly tell Gradle to use it. There are two main ways to activate it:

  • Command Line: Use the --parallel (or -P) option when running Gradle commands.
  • Configuration File: Add org.gradle.parallel=true to your project's gradle.properties file.

Using the command line option overrides the setting in gradle.properties.

All lessons in this course

  1. Build Cache & Daemon
  2. Profiling & Debugging Builds
  3. Parallel Execution & Configuration
  4. Incremental Builds and Task Inputs/Outputs
← Back to Groovy & Gradle: JVM Automation and Build Engineering