Homebrew - kanuku/misc GitHub Wiki

Versions option is obsolete


# Install the versions command
brew tap homebrew/boneyard

# now you can do 
brew versions maven

# Now choose from the listed versions:
3.2.5    git checkout 7a4f9fc /usr/local/Library/Formula/maven.rb
3.2.3    git checkout 941f311 /usr/local/Library/Formula/maven.rb
3.2.2    git checkout 47fc814 /usr/local/Library/Formula/maven.rb
3.2.1    git checkout 5750c48 /usr/local/Library/Formula/maven.rb
3.1.1    git checkout 3e039d4 /usr/local/Library/Formula/maven.rb
3.1.0    git checkout f160fa9 /usr/local/Library/Formula/maven.rb
3.0.5    git checkout b4725ca /usr/local/Library/Formula/maven.rb
3.0.4    git checkout d7a19f2 /usr/local/Library/Formula/maven.rb
3.0.3    git checkout 14e4db3 /usr/local/Library/Formula/maven.rb
3.0.2    git checkout 03b288a /usr/local/Library/Formula/maven.rb
3.0.1    git checkout 83857d6 /usr/local/Library/Formula/maven.rb
3.0      git checkout 09a0264 /usr/local/Library/Formula/maven.rb
2.2.1    git checkout d40d419 /usr/local/Library/Formula/maven.rb


# Let us first UNLINK the current maven installation to avoid conflicts.
# When you unlink with brew, brew will remove the symlinks to i.e.: /usr/bin/mvn, 
# but not the Installation of the package itself in /usr/local/Cellar/maven/3.2.5
brew unlink maven


# To install version 3.0.5 besides the current one:
cd /usr/local/Library

# With git you can checkout 3.0.5 on branch b4725ca 
git checkout b4725ca /usr/local/Library/Formula/maven.rb

# Now that our git head points to the Formula of maven version 3.0.5
# Let brew install the current head (3.0.5)
brew install maven

# There is no need to link the installation because we removed the symlink first.
# Now mvn version 3.0.5 is installed on your computer:
mvn -version


# To switch back to mvn 3.2.5
brew switch maven 3.2.5