Mar 17

If you are using Homebrew and want to use the maven formular you have to delete the symbolic link /usr/bin/mvn.

Thereby you use your homebrew maven installation instead of the shipping version of OSX.

The executable is located at /usr/local/bin/ which should be part of your path already.
The maven package itself can be found at /usr/local/Cellar/maven/3.0.3/libexec. This will be interesting for your IDE, which often wants a pointer to your maven home directory. I created a symlink current so that I can change the version to use at the command line without the need to configure my IDE again.

[/usr/local/Cellar/maven] master@struggy$ sudo ln -s 3.0.3/libexec/ current

That’s it.

3 Responses to “Homebrew and Maven”

  1. svaret says:

    Thanks a lot….

  2. fab says:

    can you write all the steps to create the symlink curret and how to configure? i don’t understand this procedure.

    thx a lot!

    • leif.hanack says:

      Hi fab,

      if you do a “ls -la /usr/bin/mvn” you should see something like this:

      “lrwxr-xr-x 1 root wheel 24 16 Dez 2012 /usr/bin/mvn -> /usr/share/maven/bin/mvn”

      The “->” shows that /usr/bin/mvn is a symbolic link.

      Setting a symlink named “current” is not necessary. If your IDE is asking for the maven home you could enter /usr/local/Cellar/maven/current. When you change maven to 3.0.4 you only need to change the symlink “current” to point to /usr/local/Cellar/maven/3.0.4/libexec/. No change inside your IDE is required.

      Hope that makes it a bit more clear.

Leave a Reply

preload preload preload