# Maven & Gradle — Advanced Java

Source: https://www.geekswithgeeks.com/en/advanced-java/adv-build-tools

> Compare Maven and Gradle for Java builds — transitive dependency resolution, the standard layout and lifecycle phases, and Gradle's incremental build cache.

## What they give you

Declarative dependencies with transitive resolution from Maven Central, a standard directory layout, a phased lifecycle (`compile → test → package → verify → install`), and a plugin ecosystem. Maven is XML and convention-heavy; Gradle uses a Groovy/Kotlin DSL and an incremental build cache.

## Transitive conflicts

Two dependencies can pull different versions of the same library. Maven resolves by **nearest wins** (with `dependencyManagement`/BOMs to pin versions explicitly); Gradle picks the **highest version** by default. Always run a dependency-tree report before shipping to catch surprises.
