What is Apache Maven?

Maven is a powerful project management tool that is based on POM (project object model). It is used for projects build, dependency and documentation.

It simplifies the build process

A Maven repository is a directory to store all the project jars, library jar, plugins or any other artifacts.

There are three types of Maven repository.

  1. Local
  2. Central
  3. Remote

1.Maven Local:

Maven local repository is a local folder on your machine. It is created when you run any maven command for the first time. Maven local repository stores all dependency library jars, plugin jars, etc on your development machine.
2. Maven Central:

Maven central repository is a repository managed by the Maven community. This repository contains a large number of commonly used libraries involved in development of software. One can publish their own libraries to Maven central repository as well.
3. Maven Remote:

Sometimes a company or a project developmental team can set up its own repositories to host various libraries.

The company maintains a repository outside any individual developer’s machine and is called Maven remote repository.

How is Maven different from Git?

When using Maven, your project’s dependencies are well defined in pom.xml which is good for collaborative development as addition of dependencies doesn’t require other developers to be informed as Maven automatically handles dependencies itself by downloading dependencies.

Git is used for distributed version control which is very good to keep track code changes in your project.

When combined, they make collaborative development easier.