1. Concept library
  2. Java & Spring Boot
  3. Module 5: Build tools and testing

Concept

Maven and Gradle

The build tool declares dependencies, compiles, runs tests and packages the application, the same way on every machine and in CI. Maven uses an XML pom; Gradle uses a Kotlin or Groovy script.

What a session covers

The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.

  1. Explain what the build tool does from dependencies to packaging
  2. Add a dependency and run the tests through the wrapper
  3. Spot the build run with a global install instead of the wrapper

In practice

A few lines that show Maven and Gradle doing its job.

XML
<dependencies>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
  </dependency>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
    <scope>test</scope>
  </dependency>
</dependencies>
<!-- ./mvnw verify  -> compiles, tests, packages target/app.jar -->

The common mistake

Watch for

Running the build with a globally installed Maven or Gradle instead of the wrapper (mvnw, gradlew). Versions differ between machines and the build that passed for you fails in CI.

How it stays learned

Once a session shows you understand Maven and Gradle, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.

  1. Day 3First recall, while it is fresh
  2. Day 7Second, a week on
  3. Day 18Last, when it has settled

Where it leads

Topics that build on Maven and Gradle.

Next in the moduleJUnit tests →