Printing and PDF export are disabled for this content. View it online at Full Stack Learning Simplified.
Maven Introduction
Maven is the most widely used build tool for Java. It manages your libraries, compiles code, runs tests, and packages everything into a JAR or WAR β all driven by a single file.
What Maven does for you
- Dependency management β declare a library and Maven downloads it (and its dependencies).
- Build β compile, test, and package with one command.
- Standardization β every Maven project looks the same, so any developer can navigate it.
- Plugins β extend the build (code coverage, Docker images, releases).
Convention over configuration
Maven expects a standard project layout, so you configure almost nothing if you follow it.
project
my-app/
ββ src/main/java/ # your code
ββ src/main/resources/ # config, static files
ββ src/test/java/ # tests
ββ target/ # build output (generated)
ββ pom.xml # the project descriptorEverything lives in pom.xml
The pom.xml (Project Object Model) declares your project's identity, dependencies, and build settings. It's the single source of truth Maven reads.
Maven vs Gradle
Maven uses declarative XML and rigid conventions β predictable and ubiquitous. Gradle uses a flexible Kotlin/Groovy script and is often faster. Both are common; this course covers Maven, which dominates enterprise Java.
Note: The current stable line is Maven 3.9.x. Maven 4 is arriving (release candidates), but 3.9 is what most projects use today. The Maven Wrapper (
mvnw) pins the right version per project.Free preview. Sign in and subscribe to unlock all 809 lessons across 25 courses.
Free preview Β· Β© 2026 Full Stack Learning Simplified