すでにMaven2がインストールされているところにMaven3をインストールする手順です。
brew unlink maven2 brew install maven
Maven2に戻す方法
brew unlink maven brew link --overwrite maven2
$ mvn -v Apache Maven 2.2.1 (r801777; 2009-08-07 04:16:01+0900) Java version: 1.8.0_31 Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre Default locale: ja_JP, platform encoding: UTF-8 OS name: "mac os x" version: "10.10.1" arch: "x86_64" Family: "mac"
Maven3に戻す方法
brew unlink maven2 brew link --overwrite maven
$ mvn -v Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-15T02:29:23+09:00) Maven home: /usr/local/Cellar/maven/3.2.5/libexec Java version: 1.8.0_31, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre Default locale: ja_JP, platform encoding: UTF-8 OS name: "mac os x", version: "10.10.1", arch: "x86_64", family: "mac"