Programming foundations

Stage 6 · Lesson 2 of 8

Maven or Gradle builds

Build and ship your first projects

Real Java projects are built with or Gradle rather than by running javac by hand. Both are build tools. They use a standard layout, src/main/java for code and src/test/java for tests.

They download the libraries you declare, compile your code, run the tests and package a , a single file that bundles your compiled code. Maven describes the project in pom.xml, and Gradle in build.gradle or build.gradle.kts. Pick one: Maven is more rigid and predictable, Gradle more flexible.

Commit the wrapper scripts (mvnw or gradlew), so a stranger can run ./mvnw test or ./gradlew test without installing anything. Add target/ or build/ to .gitignore. Declare each once with a fixed version, and learn to read the "cannot find symbol" errors that a missing causes.

A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it

Resources for this stage

Start with

  • GitHub repoFree
    Project Based Learning

    Community maintained · Beginner

    Follow one guided build in your language, then build your own without a guide

Keep handy

  • Free APIs that give a small project real data to work with

Also worth your time

Mark this stage as not done?