Download, Install and Configure Maven

Tags:

Introduction

Apache Maven is a powerful build automation tool for Java based projects, it is built based on the concept POM (Project Object Management).

Download and Install Maven

To download Maven, go to Maven Downloads website and download the latest Maven version available.

Configure Maven

Once you downloaded and installed, you are good to start using Maven, but there are some configurations that you may want to make to fulfill different requirements.

How to install jars into local Maven repo

If you have some jars/artifacts built locally or not available through Maven repository, then you can install them into local repository using below command and use them in POM file.


mvn install:install-file -Dfile=/path/to/jar/file -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging> (jar/war/zip etc);

If there is a pom file that you would like to install into local maven repository, you can install it using below command.


mvn install:install-file -Dfile=/path/to/jar/file -DpomFile=/path/to/pom/file