Apache Maven

An XML file describes the software project being built, its dependencies on other external modules and components, the build order, directories, and required plug-ins.

Maven is built using a plugin-based architecture that allows it to make use of any application controllable through standard input.

[3] Alternative technologies like Gradle and sbt as build tools do not rely on XML, but keep the key concepts Maven introduced.

With Apache Ivy, a dedicated dependency manager was developed as well that also supports Maven repositories.

[5][6] Maven was created by Jason van Zyl in 2002 and began as a sub-project of Apache Turbine.

Example file: This POM defines a unique identifier for the project (coordinates) and a single dependency on the JUnit library.

The directory structure of a normal idiomatic Maven project has the following directory entries: The command mvn package will compile all the Java files, run any tests, and package the deliverable code and resources into target/my-app-1.0.jar (assuming the artifactId is my-app and the version is 1.0.)

For example, one can configure the compiler-plugin to use Java version 1.5 for compilation, or specify packaging the project even if some unit tests fail.

There are Maven plugins for building, testing, source control management, running a web server, generating Eclipse project files, and much more.

[11] The build lifecycle is a list of named phases that can be used to give order to goal execution.

Tools like diet4j[13] can use this information to recursively resolve and run Maven modules at run-time without requiring an "uber"-jar that contains all project code.

Maven's dependency-handling mechanism is organized around a coordinate system identifying individual artifacts such as software libraries or modules.

The Maven command mvn install builds a project and places its binaries in the local repository.

For example, Eclipse's JDT has the ability to recompile a single Java source file after it has been edited.

Many IDEs work with a flat set of projects instead of the hierarchy of folders preferred by Maven.

The number of artifacts on Maven's central repository has grown rapidly
A directory structure for a Java project auto-generated by Maven