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

Subprojects & Configurations

Define and configure subprojects, understanding how they interact within a multi-project build.

Welcome to Subprojects!

In large software projects, keeping everything in one giant build file can get messy. This is where subprojects come in handy!

Subprojects allow you to break down a big project into smaller, manageable modules. Think of them as mini-projects living within your main project.

  • Modularity: Organize code logically.
  • Reusability: Share common logic across modules.
  • Faster Builds: Gradle can optimize builds by only working on changed subprojects.

Declaring Subprojects

To tell Gradle about your subprojects, you use the settings.gradle file. This file lives in your root project directory.

You use the include keyword, followed by the path to your subproject's directory. Each subproject usually resides in its own folder.

/* settings.gradle */
rootProject.name = 'my-multi-project'

include 'app'
include 'library'

All lessons in this course

  1. Monorepo Project Structure
  2. Subprojects & Configurations
  3. Inter-Project Dependencies
  4. Composite Builds and Build Composition
← Back to Groovy & Gradle: JVM Automation and Build Engineering