Part 15 / Topic 1 of 7
Why a build tool, at all
Every program in this course so far has been compiled by hand: one javac call (Part 1), javac *.java for a few files (Part 7), javac -d out $(find src -name "*.java") once packages showed up (Part 8 onward), one external jar added to -cp by hand for a single dependency (Part 11's sqlite-jdbc). That ladder works right up until a project needs more than one external dependency, needs its tests run as part of "build this," or needs to be handed to someone else who shouldn't have to reconstruct your exact -cp string from memory.
Think of cooking for one person with ingredients already in the kitchen, versus running a restaurant kitchen: at some point "I just know where everything is" stops scaling, and you want a system that fetches, checks, and assembles things the same way every time, for anyone.
A build tool automates, as one repeatable command: fetching dependencies (and their dependencies — Part 11 needed exactly one jar; a real project needs a dependency's dependencies resolved too), compiling, running tests, and packaging the result. Maven and Gradle are the two build tools in real-world Java use; this part gets Maven running for real, since it's the one actually installed and pinned for this course (../../TOOLING.md), and covers Gradle's shape conceptually (section 6).
🔍 Going deeper: a build tool does not replace
javac/java— it calls them, with the right classpath, assembled automatically. Everymvn compilein this part is still running the samejavacyou've used since Part 1, underneath.
Done here? The practice set for Part 15 — including the solutions — is on the part page.