JVM Build Tools Cheat Sheet

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

The reference material consulted while preparing these pages is listed in the section bibliography.

A single-page, colour-coded summary of the three JVM build tools, written against Apache Ant 1.10.18 (with Ivy 2.6.0 and the Maven Resolver Ant Tasks 2.0.0), Apache Maven 3.10.0 (with the Maven 4.0.0-rc-7 release candidate labelled as such) and Gradle 9.8.1, and checked on 2026-10-17. It opens with the concepts the three tools share (coordinates and the repository layout, transitive dependencies and each tool’s conflict strategy, snapshots and releases, ranges and dynamic versions, BOMs and platforms, locking and verification, wrappers, incremental and reproducible builds). The Ant block covers the command-line options used most, a build.xml skeleton, properties, filesets, selectors, mappers and filterchains, the core tasks, import, include and subant, a macrodef with @{} attributes, a custom task in ten lines, Ivy (ivy.xml, configuration mappings, resolve, cachepath, retrieve, publish, conflict managers) and the Maven Resolver Ant Tasks. The Maven block covers the command line (-pl, -am, -amd, -rf, -s, -t and the rest), the lifecycles with their jar bindings, a POM skeleton, scopes, BOM imports, inheritance and aggregation, settings.xml and mirrorOf, profile activation, Surefire and Failsafe naming, Central publishing, enforcer rules, a Mojo skeleton and the 3.9 to 3.10 breaking changes, followed by a Maven 4 strip (model version 4.1.0, the consumer POM, <subprojects>, the bom packaging, before: and after: phases, all and each, -r, mvnup, mvnenc). The Gradle block covers the command line (including --write-locks, --continue and -t), the three build phases, settings.gradle.kts with includeBuild, a Kotlin DSL build script with a toolchain, dependency locking, a JVM Test Suite and maven-publish, a version catalog, the dependency configurations and rich versions, a custom task with @Input, convention plugins, and the gradle.properties and wrapper checksum settings. A table then sets the three tools side by side (everyday commands, build files, scopes, configurations and Ivy configurations, parent POM, convention plugin and import, profiles and their equivalents, reactor, multi-project builds and subant), and a "then → now" strip lists what each release replaced — handy for quick memorization or as a downloadable PDF desk reference.

For the full explanation, every option, and additional examples, see the dedicated pages:

Apache Ant: Getting started — Apache Ant Overview, Versions & Release History, Installation, and Running Ant.

Apache Ant: Practice — Deprecations & Migration.

Apache Maven: Repositories, settings and profiles — Repositories, Mirrors & Repository Managers, settings.xml & Password Encryption, and Profiles.

Apache Maven: Multi-module builds — Multi-Module Builds & the Reactor and CI-Friendly Versions.

Apache Maven: Releasing and publishing — Install, Deploy & Distribution Management, Releasing, Publishing to Maven Central, and Archetypes.

Apache Maven: Maven 4 (release candidate) — Maven 4: What’s New, Maven 4: POM Model & Consumer POM, Maven 4: Lifecycle, and Migrating to Maven 4.

Apache Maven: Practice — Troubleshooting & Best Practices.

Gradle: JVM builds, testing and publishing — Java Projects, Toolchains, Testing JVM Projects, and Publishing.

Ecosystem — Ecosystem.