What is Maven?

In short
Maven is a build and project management tool for Java and other software projects. It uses a single project file, the POM, to describe your code, its dependencies and how it should be built, so builds follow shared conventions instead of custom scripts.
What Maven does
Maven helps you manage a software project from start to finish. It covers building the code, running tests, tracking dependencies, creating documentation and publishing finished packages. The main idea is to apply shared patterns to a project's build setup, so that anyone who knows Maven can quickly find their way around a new codebase.
Maven is more than a build tool. It is a project management tool that can help with builds, documentation, reporting, dependencies, source control, releases and distribution.
How Maven benefits your process
Maven uses standard conventions for where files live and how a build runs. You do not need to write a custom script for each project. Because most projects follow the same layout, new team members spend less time learning the build and more time writing code. Consistent conventions also make builds more predictable, which helps teams reach a higher rate of success when they ship.
The POM file
The central piece of Maven is the Project Object Model, stored in a file called pom.xml. The POM is the basic unit of work in Maven. Everything revolves around the idea of a project. The POM holds the key facts about your project in one place.
A minimal POM has a few key elements. The project element is the top level of the file. The modelVersion element states which version of the POM format is used. The groupId identifies the organization or group that created the project, and is often based on a domain name your organization owns. The artifactId is the base name of the main output, usually a JAR file. The version tells you which release the project is, and a SNAPSHOT suffix means the project is still in development. The dependencies element lists the libraries your project uses, and the build element controls things like the directory layout and plugins.
Creating a first project
Maven provides archetypes, which are templates that produce a ready-to-use project. You can generate a simple project from the command line with the archetype:generate goal:
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.5 -DinteractiveMode=false
This creates a folder called my-app containing a pom.xml file, a src/main/java folder for application code and a src/test/java folder for tests. Application sources go in src/main/java and test sources go in src/test/java, relative to the folder that holds pom.xml. Maven expects this layout by convention.
Compiling and building
To compile your application code, change into the folder with pom.xml and run mvn compile. Maven reads the POM, downloads any plugins and dependencies it needs, and then compiles the sources into a target folder. The first run can take a while because Maven downloads everything it needs. Later runs reuse what is already on your machine and finish much faster.
Common mistakes
Beginners often put source files in the wrong folder, which breaks the standard layout and makes Maven miss them. Another common issue is editing the POM without checking the XML syntax, since a small mistake can stop every command. Finally, many people forget that the first build needs network access to fetch plugins. If you are behind an HTTP proxy or want a different cache location, you need to add Maven configuration, as described in the official configuration guide.
Alternatives
Gradle is another popular build tool for Java and other languages. It uses a different build script format and is often chosen for flexibility. Maven is still widely used for its strong conventions and its large library of plugins. Choosing between them usually depends on your team's needs and what the existing projects already use.
FAQ
Do I need to install anything special to use Maven?
You need a working Java setup and the Maven program itself. The official defaults are often enough, and you only need extra configuration if you change the cache location or use an HTTP proxy.
Why does my first Maven build take so long?
Maven downloads the plugins and dependencies it needs the first time it runs a command. Once they are on your machine, later builds reuse them and run much faster.
What does SNAPSHOT mean in a version number?
A SNAPSHOT suffix, such as 1.0-SNAPSHOT, means the project is still in development and has not been released as a fixed version.
Is the pom.xml file the only thing I need to edit?
For a simple project, the POM is the main file you edit. Extra settings for the machine, such as proxies or cache locations, go in a separate Maven configuration rather than in each project.
Sources
This page is based on the official documentation below. Read it for full detail.
Maven — official documentation ↗Maven in the news
Docker VMM Reaches General Availability in Docker Desktop 4.101
Docker has made Docker VMM generally available in Docker Desktop 4.101 for macOS, Windows and Linux. The company also published fixed Docker Hardened Images for Java4Shell and NGINX HTTP/2.
Quarkus 4.0 Reaches GA on JDK 21 Baseline as Vector API Moves Toward JDK 28
Quarkus 4.0 became generally available with a JDK 21 baseline and Vert.x 5, while the Vector API's thirteenth incubation was proposed for JDK 28. Several other Java libraries also shipped releases in the same week.
JDK 28 Lets ZGC Prepare Heap Memory in the Background, Ending the Startup-or-Warmup Trade-off
JEP 545 has landed in JDK 28 and moves ZGC's heap memory preparation onto concurrent worker threads. A new adaptive sizing option, paired with it, lets Java services start fast and warm up quickly without choosing between the two.


