The installation of Apache Maven is a simple process of extracting the archive and adding the `bin` folder with the `mvn` command to the `PATH`.
Maven Settings.xml Mac Os X
Detailed steps are:
- Ensure
JAVA_HOME
environment variable is set and points to your JDK installation - Extract distribution archive in any directory
The post will guide you step by step to install Apache Maven in Operating system like Solaris, Mac OS and various Linux distributions like RHEL, CentOS, Ubuntu, Fedora. The post also provide steps to set environment variables for Apache Maven on Linux, Solaris and Mac OS X. Maven allows use of a central maven repository. The pom.xml (Project Object Model) file describes project dependencies which Maven resolves by downloading them. NOTE: Some prefer to install and use the Cargo plugin (from Codehaus) to Maven in order to eliminate use of pom.xml.
or
Alternatively use your preferred archive extraction tool.
- Add the
bin
directory of the created directoryapache-maven-3.6.3
to thePATH
environment variable - Confirm with
mvn -v
in a new shell. The result should look similar to
Windows Tips
- Check environment variable value e.g.
- Adding to
PATH
: Add the unpacked distribution’s bin directory to your user PATH environment variable by opening up the system properties (WinKey + Pause), selecting the “Advanced” tab, and the “Environment Variables” button, then adding or selecting the PATH variable in the user variables with the valueC:Program Filesapache-maven-3.6.3bin
. The same dialog can be used to setJAVA_HOME
to the location of your JDK, e.g.C:Program FilesJavajdk1.7.0_51
- Open a new command prompt (Winkey + R then type
cmd
) and runmvn -v
to verify the installation.
Unix-based Operating System (Linux, Solaris and Mac OS X) Tips
- Check environment variable value
- Adding to
PATH