See the following mvn version. I'm wondering why "which" command does not give you the correct info.
LM-SIN-00676037:myproject haibliu$ mvn --version
Apache Maven 3.0.3 (r1075438; 2011-03-01 01:31:09+0800)
Maven home: /usr/share/maven
Java version: 1.6.0_37, 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.8", arch: "x86_64", family: "mac"
LM-SIN-00676037:myproject haibliu$ which mvn
/usr/local/bin/mvn
LM-SIN-00676037:myproject haibliu$ /usr/local/bin/mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 16:44:56+0800)
Maven home: /usr/local/Cellar/maven/3.0.4/libexec
Java version: 1.6.0_37, 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.8", arch: "x86_64", family: "mac"
Just to clarify: /usr/bin/mvn comes with my Max OS X, Mountain Lion. And I used Homebrew to install /usr/local/bin/mvn. After that, I changed the order of PATH in /etc/paths.
LM-SIN-00676037:myproject haibliu$ cat /etc/paths
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
LM-SIN-00676037:myproject haibliu$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
That's all I did. And I'm using bash shell.
which -a
and see what comes up./usr/local/bin/mvn
after runningmvn
in the current shell instance once? Bash tends to cache binary locations.type mvn
andpwd
should let you know if the result is already hashed by the shell and if you happen to be in a directory where the path is choosing the local mvn over the one "which" finds first... If mvn is hashed, you simply have to re-start your shell or otherwise force a rehash. Feel free to write this up as an answer once you've sussed which of the above is causing your temporary grief with mvn.