I\'m trying to install maven through the terminal by following these instructions.
So far I got this
export M2_HOME=/user/apple/apache-maven-3.0.3
ex
This command brew install maven30
didn't work for me. Was complaining about a missing FORMULA. But the following command did work. I've got maven-3.0.5 installed.
brew install homebrew/versions/maven30
This is for Mac OS X 10.9 aka Mavericks.
For those who wanna use maven2 in Mavericks, type:
brew tap homebrew/versions
brew install maven2
If you have already installed maven3, backup 3 links (mvn, m2.conf, mvnDebug) in /usr/local/bin
first:
mkdir bak
mv m* bak/
then reinstall:
brew uninstall maven2
(only when conflicted)
brew install maven2
You can install maven using homebrew. The command is
$ brew install maven
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. Run java
by itself and it'll prompt you to install it.
Assuming qualifications are met, run mvn -version
and see some output like this:
Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
Maven home: /usr/share/maven
Java version: 1.6.0_29, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.7.2", arch: "x86_64", family: "mac"
If using MacPorts on OS X 10.9 Mavericks, you can simply do:
sudo port install maven3
sudo port select --set maven maven3
If you don't want to install Homebrew only for install Maven you could simply do this:
Download the binary Maven and extract the zip
Launch the Terminal and type this command:
sudo ln -s /path_to_maven_folder/bin/mvn /usr/bin/mvn
You can find more details on this post.