Updating Maven on OSX with homebrew

Update: Having trouble keeping your Apache Maven installation up to date? The you should read Maven Wrapper - the Pendant to the Gradle World

Lately I had to update Maven on a OSX developer machine an thought it might be worth to record this low frequency task for the future. Our show case: Upgrading Maven from 3.1.1 to 3.2.5.

Get your local brewery up to date in case you sparsely use it like I do.

brew update

Install the new version:

brew install maven
Error: maven-3.1.1 already installed
To install this version, first `brew unlink maven'

Ooops. It's an update. Thanks for the pointer brew.

brew unlink maven
Unlinking /usr/local/Cellar/maven/3.1.1... 4 symlinks removed

2nd try:

brew install maven
==> Downloading http://www.apache.org/dyn/closer.cgi?path=maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz
==> Best Mirror http://mirrors.koehn.com/apache/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz
######################################################################## 100.0%
🍺  /usr/local/Cellar/maven/3.2.5: 85 files, 9.1M, built in 3 seconds

Success. Let's verify the result...

mvn -v
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
Maven home: /usr/local/Cellar/maven/3.2.5/libexec
Java version: 1.8.0, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.2", arch: "x86_64", family: "mac"