Install Maven on Mac

Source: Internet
Author: User

Http://www.tuicool.com/articles/ZV3yUn

Recently I upgraded my Mac OS X to Mavericks (10.9) and I were surprised to see this it doesn ' t come with Maven. Earlier versions of Mac OS X such as Lion and Mountain Lion used to has Maven installed by default.

There is some third party options such as HomeBrew and using XCode to install Maven in Mac OS X Mavericks but I wanted to Do it myself without relying on another software for getting maven working.

Here is the steps that I used to install MAVEN on Mac OS X Mavericks.

Step 1 : Download maven binaries from maven Download Page. I was using the Maven 3.0.5, so I downloaded apache-maven-3.0.5-bin.tar.gz.

Step 2 : You can install Maven @ since it's a one time process, I didn ' t wanted it in my user D Irectory. So I installed it in /usr/local directory. You might has the use of sudo command to install in/usr/local directory if your is getting permission denied error.

$ cd/usr/local$ su domv/users/pankaj/downloads/apache-maven-3.0. 5-bin.tar.gz./$ sudo tar-xvf apache-maven-3.0. 5-bin.tar.gz    

Step 3 : Now open the Bash profiles file and add following lines into it. Usually profile file names is. bash_profile or. Profile, and use whichever the your system. If you do have a profile file, you'll have the to create one with VI command.

$HOME $ vi. bash_profile#Add below lines in the Profileexport m2_home=/usr/local/apache-maven-3.0.5export path=$ PATH:$M 2_home/bin#save and quit$ source. Bash_profile   

That's it, MAVEN is installed on your latest MAC OS X and you can verify it by issuing below command.

$ mvn--versionapache Maven3.0.5 (R01DE14724CDEF164CD33C7C8C2FE155FAF9602DA; 2013-02-19  05: 51:28-0800) Maven home: /usr/ Local/apache-maven-3.0.5java version: 1.7.0_09, vendor:oracle Corporationjava home: /library/java/javavirtualmachines/ Jdk1.7.0_09.jdk/contents/home/jredefault Locale:en_us, platform Encoding:utf-8os Name:  "Mac OS X", Version:  "10.9", Arch:  "x86_64", Family:  "Mac"       

You can use the This method to install any MAVEN version of would like to use and at your specified location.

Let me know if you find any issues with above setup steps

Install Maven on Mac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.