Installing Maven

After few years of not needing it, I came back to Maven, reason being that I cannot use Gradle for reasons beyond my control and Ant does not describe complex projects structures required.


Getting new version of Maven


$ brew install maven
==> Downloading ....
/usr/local/Cellar/maven/3.2.3:
$ mvn -version

Apache Maven 3.2.3
$ which mvn
/usr/local/bin/mvn


Setting M2_HOME


$ echo $M2_HOME
# nada


I added the following in my ~/.profile




# Maven - updated: Oct 20, 2014
export MAVEN_HOME=/usr/local/Cellar/maven/3.2.3/
export PATH=${PATH}:${MAVEN_HOME}/bin
export M2_HOME=/usr/local/Cellar/maven/3.2.3/
export PATH=${PATH}:${M2_HOME}/libexec


and run:

$ echo $M2_HOME
/usr/local/Cellar/maven/3.2.3/

No comments:

Post a Comment