build wrapper
A small script committed to a project that downloads and runs the exact build tool version the project expects.
In more detail
mvnw and gradlew mean a new machine needs no build tool installed, and that every developer and the build server use the same version. Commit the wrapper files to the repository whichever tool you choose. Running ./mvnw test is exactly like running mvn test with the pinned version.
Examples
./mvnw -B -ntp test./gradlew test --console=plainRelated terms
- Maven — A build tool for Java in which a project declares itself in a pom.xml file and is built by a fixed lifecycle of phases.
- Gradle — A build tool whose build is a script in a programming language and a graph of tasks that are skipped when their inputs have not changed.
- pinning — Fixing an exact version or digest of something you depend on so it cannot change without you noticing.
- reproducible build — A build that produces the same result every time from the same inputs.
Taught in
- The Toolchain: Maven — Modern Java: Virtual Threads & High-Throughput Services
- The Toolchain: Gradle — Modern Java: Virtual Threads & High-Throughput Services
- Packaging Into A Container — Modern Java: Virtual Threads & High-Throughput Services