I've never used maven before but recently I was need to start use it. When I run
mvn
from terminal I get
-bash: mvn: command not found
Then I decided that maven not installed and run:
brew install maven
I get the following exeption:
Error: maven-3.2.1 already installed To install this version, first `brew unlink maven'
When I run
brew info maven
I get the following:
maven: stable 3.2.5 http://maven.apache.org/ /usr/local/Cellar/maven/3.2.1 (65 files, 7.8M) * Built from source From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/maven.rb
When I go to this folder and run
./mvn -version
I got the following:
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T19:37:52+02:00) Maven home: /usr/local/Cellar/maven/3.2.1/libexec Java version: 1.6.0_65, 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.10.3", arch: "x86_64", family: "mac"
Now the question what was wrong with my maven installation? Is it enough manually write alias to it environment variables to get it work. If yes, how to do it right? If not, what do I need to do to get it work?
Thank you very much in advance.
UPDATE:
I've added /usr/local/Cellar/maven/3.2.1/bin/
to /etc/paths
and it seems to work now. But I still don't know is it right fix.