Interview Prep/CI/CD/Build Tools and Artifact Repositories

How do you cache dependencies and speed up Maven builds in CI?

IntermediateConceptBuild Tools and Artifact Repositories
Answer

Cache ~/.m2/repository keyed on pom.xml hashes, use a mirror proxy, build with -T 1C for parallel module builds, skip work you do not need (-DskipTests in a package-only job, but never in the test job), and use -B batch mode with -ntp to suppress download progress logs.

mvn -B -ntp -T 1C verify
All CI/CD questions Roadmap: CI/CD fundamentals

More on Build Tools and Artifact Repositories