Apache Maven is a tool for project management and build automation. This tag is for questions relating to Maven version 3.x. For non version-specific questions, please use the [maven] tag.
Apache Maven is a tool for project management and build automation. Maven relies on a pom.xml
file that describes the project instead of defining a set of tasks, like Ant does.
A basic pom.xml
looks like:
<project>
<!-- model version is always 4.0.0 for Maven 2 and Maven 3 POMs -->
<modelVersion>4.0.0</modelVersion>
<!-- A project is identified by its groupId, artifactId and version -->
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1.0</version>
<!-- Dependencies -->
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<!--
The scope allows you to limit the usage of this dependency.
In this case, this library will only be used for tests purposes.
-->
<scope>test</scope>
</dependency>
</dependencies>
</project>
Many plugins exist, and offer more functionalities to the tool.
For non version-specific questions, please use maven, for the older maven versions 2.x or the legacy 1.x use maven-2 or maven-1, respectively.
If you see questions related to a specific Maven plugin, please also check whether the related plugin tag is present (i.e. maven-jar-plugin, maven-surefire-plugin).
Questions related to Maven plugin development should also have the maven-plugin, while questions related to Maven profiles should also have the maven-profiles tag and questions related to Maven archetypes should also have the maven-archetype tag.