liveBook · Manning

Gradle subproject

As explained in Microservices Patterns, Second Edition

A Gradle subproject is an independently configurable project within a larger Gradle build, with its own source code, dependencies, and build tasks.

A Gradle subproject is a buildable, testable unit within a larger build. Dependencies let one subproject use another’s classes and determine which projects Gradle recompiles and retests after a change. section 4.3 section 4.3.1

The dependency graph sets the scope of build feedback:

  • Changing money triggers recompilation and tests for money and its dependents: accounting, customer-management, and order-management. section 4.3.1
  • Changing customer-management affects only that project and order-management; unrelated projects are left alone. section 4.3.1
  • Splitting web, persistence, and domain into separate subprojects avoids running persistence tests after a web-only change. section 4.3.3
Figure 4.9 The dependencies between Gradle projects create build-time coupling. Changing money causes the other projects to be recompiled and retested but changing customer-management only requires customer-management and order-management to be recompiled and retested.
gradle build time coupling

The dependency diagram shows how a change to money reaches more projects than a change to customer-management. section 4.3.1

How Microservices Patterns, Second Edition covers it

How deep it goes
Explains dependency-driven incremental recompilation and retesting, including transitive effects and project splitting, but not configuration syntax.
Examples
Uses FTGO dependency chains and a web, persistence, and domain split to illustrate rebuild and test scope.
What you can do after
Apply Gradle project boundaries and dependencies to limit unrelated recompilation and test execution.
How it connects
Connects build-time coupling with Gradle project dependencies, incremental builds, and monolithic architecture.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microservices Patterns, Second Edition. The section links point to the parts of the book it draws on.