zoukankan      html  css  js  c++  java
  • Mac上安装 Maven

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

    Recently I upgraded my Mac OS X to Mavericks (10.9) and I was surprised to see that it doesn’t come with Maven. Earlier versions of Mac OS X such as Lion and Mountain Lion used to have maven installed by default.

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

    Here are 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 Maven 3.0.5, so I downloaded apache-maven-3.0.5-bin.tar.gz.

    Step 2 : You can install Maven at any location but since it’s a one time process, I didn’t wanted it in my user directory. So I installed it in /usr/local directory. You might have to use sudo command to install in /usr/local directory if you are getting permission denied error.

    $ cd /usr/local
    $ sudo mv /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 profile file and add following lines into it. Usually profile file names are .bash_profile or .profile, use whichever you have in your system. If you don’t have profile file, you will have to create one with vi command.

    $ cd $HOME
    $ vi .bash_profile
    #Add below lines in the profile
    export M2_HOME=/usr/local/apache-maven-3.0.5
    export PATH=$PATH:$M2_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 --version
    Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 05:51:28-0800)
    Maven home: /usr/local/apache-maven-3.0.5
    Java version: 1.7.0_09, vendor: Oracle Corporation
    Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: "mac os x", version: "10.9", arch: "x86_64", family: "mac"

    You can use this method to install any maven version you would like to use and at your specified location.

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

  • 相关阅读:
    分享一个在线生成站点地图SiteMap制作工具
    去掉tppabs冗余代码,怎样批量去掉tppabs代码
    js文字无缝滚动
    史上最全的Win8快捷键大全
    原码, 反码, 补码
    Java [Leetcode 136]Single Number
    拉格朗日对偶
    随机森林与GBDT
    GBDT(Gradient Boosting Decision Tree)算法&协同过滤算法
    Java [Leetcode 165]Compare Version Numbers
  • 原文地址:https://www.cnblogs.com/wind90/p/4767863.html
Copyright © 2011-2022 走看看