Maven Install on Mac OS X

后端 未结 24 2010
野性不改
野性不改 2020-11-27 08:46

I\'m trying to install maven through the terminal by following these instructions.

So far I got this

export M2_HOME=/user/apple/apache-maven-3.0.3
ex         


        
相关标签:
24条回答
  • 2020-11-27 09:19

    This command brew install maven30 didn't work for me. Was complaining about a missing FORMULA. But the following command did work. I've got maven-3.0.5 installed.

    brew install homebrew/versions/maven30
    

    This is for Mac OS X 10.9 aka Mavericks.

    0 讨论(0)
  • 2020-11-27 09:19

    For those who wanna use maven2 in Mavericks, type:

    brew tap homebrew/versions

    brew install maven2

    If you have already installed maven3, backup 3 links (mvn, m2.conf, mvnDebug) in /usr/local/bin first:

    mkdir bak

    mv m* bak/

    then reinstall:

    brew uninstall maven2(only when conflicted)

    brew install maven2

    0 讨论(0)
  • 2020-11-27 09:22

    You can install maven using homebrew. The command is $ brew install maven

    0 讨论(0)
  • 2020-11-27 09:23

    OS X prior to Mavericks (10.9) actually comes with Maven 3 built in.

    If you're on OS X Lion, you won't have java installed by default. Run java by itself and it'll prompt you to install it.

    Assuming qualifications are met, run mvn -version and see some output like this:

    Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
    Maven home: /usr/share/maven
    Java version: 1.6.0_29, 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.7.2", arch: "x86_64", family: "mac"
    
    0 讨论(0)
  • 2020-11-27 09:23

    If using MacPorts on OS X 10.9 Mavericks, you can simply do:

    sudo port install maven3
    sudo port select --set maven maven3
    
    0 讨论(0)
  • 2020-11-27 09:23

    If you don't want to install Homebrew only for install Maven you could simply do this:

    1. Download the binary Maven and extract the zip

    2. Launch the Terminal and type this command:

      sudo ln -s /path_to_maven_folder/bin/mvn /usr/bin/mvn

    You can find more details on this post.

    0 讨论(0)
提交回复
热议问题