liveBook · Manning

Gradle Project

As explained in Microservices Patterns, Second Edition

A configuration and set of tasks that transforms source code into compiled or packaged software artifacts.

A Gradle build project organizes source into subprojects that build and test components. Dependencies between subprojects determine which ones Gradle recompiles and retests after a change, creating build-time coupling that can delay developer feedback. section 4.3 section 4.3.1

Dependency direction determines which work a change triggers:

  • Changing Money in the money project triggers tests in money and dependent projects, including accounting, customer-management, and order-management. section 4.3.1
  • Changing Customer in customer-management affects customer-management and order-management, but not money or accounting. section 4.3.1

Separate unrelated implementation concerns

If order-management’s web and persistence packages share one project, changing either can trigger tests for both. Put them in separate implementation projects that depend on the domain project to avoid that unnecessary work. section 6.3.4

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

Shows how direct and transitive project dependencies determine which projects are recompiled and retested after changes. section 4.3.1

How Microservices Patterns, Second Edition covers it

How deep it goes
Traces incremental rebuild and retest effects through direct and transitive dependencies, then shows project separation to avoid unrelated tests.
Examples
Uses FTGO projects for money, accounting, customer-management, and order-management, plus web and persistence implementation projects.
What you can do after
Diagnose/debug with it by tracing project dependencies to predict recompilation and retesting, then separate unrelated implementation projects.
How it connects
Connects build-time coupling with incremental builds, dependency management, and deployment pipelines.

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.