Disclaimer: Here is a complete answer taking the last version of OS X (10.9 AKA Mavericks) into account.I am aware that everything I compiled in this answer is already present in the page, but having it clearly in one answer makes it a lot clearer. OS X prior to Mavericks (10.9) actually comes with Maven 3 built in. If you're on OS X Lion, you won't have java installed by default. Just run java by itself and it'll prompt you to install it. Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
Since Lion 10.7.1 10.6.8 MacOSx Snow Leopard (correct me if wrong), Mac OS X comes with Apache Maven 3 built in, and can be located at
/usr/share/maven
4 Download.ir
1. Maven Built-In
- Home » org.apache.maven » apache-maven » 3.5.4 Apache Maven Distribution » 3.5.4 The Apache Maven distribution, source and binary, in zip and tar.gz formats.
- Release Notes – Maven 3.5.0. The Apache Maven team would like to announce the release of Maven 3.5.0. Maven 3.5.0 is available for download. Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project’s build, reporting and documentation from a central place.
To verify the Maven installation, in terminal, issue the command
mvn -version
.1.1 – Where is Maven installed?
A quick check with
A quick check with
whereis
command :Apache Maven 3.0.4 Download
By default, Maven is installed at
/usr/share/maven
. No configuration is needed.2. Install Maven Manually
After the upgrade of Mac OS X Mavericks, Maven was removed (no idea why). So, You have to install it manually.
2.1 – Download Maven
Download the Maven, for example
Download the Maven, for example
apache-maven-3.1.1-bin.tar.gz
. Extracts it,2.2 – Set Maven command in environment variable.
Update
Update
~/. bash_profile
– create this file if doesn’t exist.~/.bash_profile
Restart the terminal. Test it.
3. Post Configuration
A common post-installation for Maven, change the local repository to another location.
Above example changed the default repository from
~/.m2/repository
to /Users/mkyong//maven/repo/
.