Docs
Using Maven to build your projects, from a first project to multi-module builds, repositories, toolchains and Maven 4.
New to Maven?
Follow the five steps at the top of Get started: create a project, add a dependency, configure a plugin, test and build it, and split it into modules, all on one small project.
Get started
Install Maven, build a first project and learn the few ideas everything else rests on.
- 1. Create your first project
- 2. Add your first dependency
- 3. Add and configure your first plugin
- 4. Test and build your project
- 5. Split your application into modules
- Install Maven
- Maven on Windows
- What is Maven?
- Philosophy of Maven
- Phases, goals and plugins
- Standard directory layout
- The POM explained
- Build an existing project
- Getting started questions and answers
Configure Maven
settings.xml, maven.config and jvm.config, proxies, credentials and profiles.
Dependencies and repositories
How Maven finds the libraries you use, and how to point it at your own repositories.
- How dependencies work
- Optional dependencies and exclusions
- Repositories explained
- Use a mirror or repository manager (Nexus, Artifactory)
- Why use a repository manager
- Use several repositories
- Install a third-party JAR locally
- Deploy a third-party JAR to a remote repository
- Authenticated HTTPS repositories
- Resolver transport
- HTTP options of the Wagon transport
- Alternative Wagon providers
- Large centralized deployments
- Naming your coordinates
Multi-module projects
Split a build into modules, build part of it, and share configuration between modules.
Java versions and toolchains
Compile for an older Java, or build with a different JDK than the one Maven runs on.
Plugins, extensions and tools
The plugins and extensions that do the work of a build, how to configure them, and the tools around Maven.
Build recipes
Common jobs in a build, from generated sources and fat JARs to reproducible builds and releases.
Project site
Generate a documentation site for your project and write its pages in Markdown or another format.
Maven 4
What changes in Maven 4 and how to move a build to it.
Reference
The POM, the settings, the command line and the build lifecycle in full.
Help
Frequently asked questions, books and where to ask.