Maven installation through the Homebrew package manager

First make sure that Java is installed by running the following command in the Mac Terminal application:

java -versionjava version "1.8.0_162"Java(TM) SE Runtime Environment (build 1.8.0_162-b12)Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)

You will need to have Java 1.7 or higher installed on your system.

Next, if you have the Homebrew package manager installed (https://brew.sh/), then you can easily install Maven by issuing the following command in your Mac Terminal application:

brew install maven

Make sure that you set the following environment variable in your .bashrc, or .zshrc file:

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

Ensure that Maven has been properly ...

Get Hands-On Continuous Integration and Delivery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.