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:
Start here — JVM Build Tools: Ant, Maven & Gradle.
Shared foundations — Build Automation Fundamentals, Dependency Management Fundamentals, Repositories & Publishing Across Tools, Comparing Ant, Maven & Gradle, Migrating Between Tools, Supply-Chain Security, and CI & IDE Integration.
Apache Ant: Getting started — Apache Ant Overview, Versions & Release History, Installation, and Running Ant.
Apache Ant: The build file — Build File Structure, Targets & Extension Points, Properties, Paths, Filesets & Patterns, Selectors, and Resource Collections.
Apache Ant: Datatypes and core tasks — Filters & Mappers, Conditions & Control Flow, Compiling Java, Packaging Archives, File Operations, Running Programs, Testing with JUnit & junitlauncher, Documentation & XML, Network & Remote Tasks, and Utility Tasks.
Apache Ant: Structuring and extending builds — Multi-File Builds: import, include & subant, Macros & Presets, Scripting, Listeners, Loggers & Input Handlers, Writing Custom Tasks, Custom Types, Conditions & Selectors, Antlibs & Namespaces, and Embedding Ant.
Apache Ant: Dependency management for Ant — Ivy: Overview, Ivy: Module Descriptors & Configurations, Ivy: Settings & Resolvers, Ivy: Conflicts & Versions, Ivy Ant Tasks, Ivy: Publishing & Multi-Project Builds, and Maven Resolver Ant Tasks.
Apache Ant: Practice — Deprecations & Migration.
Apache Maven: Getting started — Apache Maven Overview, Versions & Release History, Philosophy, Coordinates & Directory Layout, Installation, Getting Started, Running Maven (CLI), and Configuring Maven.
Apache Maven: The POM, lifecycle and plugins — POM Fundamentals, Inheritance, Aggregation & the Effective POM, Build Lifecycle, and Plugins & Their Configuration.
Apache Maven: Dependency management — Dependencies, Scopes & Mediation, Dependency Management & BOMs, Versions, SNAPSHOTs & Ranges, Dependency Analysis & Convergence, and Installing Third-Party JARs & Relocation.
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: Building, testing and packaging — Resources & Filtering, Compiling & Toolchains, Testing with Surefire, Integration Testing with Failsafe, Packaging JARs, WARs & Manifests, Uber JARs with Shade & Assembly, and Site & Reporting.
Apache Maven: Releasing and publishing — Install, Deploy & Distribution Management, Releasing, Publishing to Maven Central, and Archetypes.
Apache Maven: Tooling and internals — Maven Wrapper, Extensions, Build Performance: Cache, Parallel Builds & mvnd, Maven Resolver, Enforcer, Security & Reproducible Builds, and Writing Plugins.
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: Fundamentals — Gradle Overview, Versions, Compatibility & Release History, Core Concepts, Installation, Gradle Wrapper, Command-Line Interface, Build Environment & Properties, Gradle Daemon, Directories & Logging, and Build Lifecycle.
Gradle: Build authoring — Settings & Build Scripts, Kotlin DSL, and Groovy DSL & Migrating to Kotlin.
Gradle: Tasks and the lazy model — Tasks, Lazy Configuration & Providers, Writing Custom Tasks, Incremental Build, Working with Files, and Worker API & Build Services.
Gradle: Plugins and build structure — Plugins Overview, Convention Plugins & Sharing Build Logic, Binary Plugins, Testing & Publishing Plugins, Multi Project Builds, and Composite Builds.
Gradle: Dependency management — Declaring Dependencies & Configurations, Repositories & Content Filtering, Version Catalogs, Platforms, Constraints & Rich Versions, Dependency Resolution, Conflicts & Capabilities, Variant-Aware Resolution & Module Metadata, Resolution Rules & Substitution, and Dependency Locking, Verification & Caching.
Gradle: JVM builds, testing and publishing — Java Projects, Toolchains, Testing JVM Projects, and Publishing.
Gradle: Performance — Build Cache, Configuration Cache & Isolated Projects, and Performance Profiling & Build Scans.
Gradle: Integration, migration and upkeep — Ant Integration, Migrating from Maven, Init Scripts & the Tooling API, Upgrading Gradle, and Best Practices & Troubleshooting.
Ecosystem — Ecosystem.
References
The PDF summarizes the official documentation; each source is cited in full on the page listed above that covers it, and in the section bibliography.