Maven Install on Mac OS X

Source: Internet
Author: User



Disclaimer:here is a complete answer taking, the last version of OS X (10.9 AKA Mavericks) to account. I am aware that everything I compiled in this answer are already present in the page, but have it clearly in one answer M Akes it a lot clearer.



First of all, with previous versions of OS X, Maven was installed by default. If Java is missing running [email protected]:~ $ Java in a terminal would prompt you for the Java installation.



With Mac OS X 10.9 (Mavericks), Maven isn't installed by default anymore. Different options is then possible:

  • Using Homebrew:

    • [Email protected]:~$ Brew install maven would install MAVEN 3.1 which might cause issues
    • [Email protected]:~$ Brew Install maven30 would install Maven 3.0 which should be Using MacPorts: (I did not test this)
    • [Email protected]:~$ sudo port install Maven3 'll install Maven 3.0.5
    • [Email protected]:~$ sudo port select–set maven Maven3 selects that version of Maven
  • Installing by hand:
    • Download Maven from its homepage
    • Follow the installation instructions:
      1. Extract the distribution archive, i.e. apache-maven-3.1.1-bin.tar.gz to the directory of your wish to install Maven 3.1.1. These instructions assume you chose/usr/local/apache-maven. The subdirectory apache-maven-3.1.1 is created from the archive.
      2. In a command terminal, add the m2_home environment variable, e.g. export m2_home=/usr/local/apache-maven/apache-maven-3.1 .1.
      3. ADD the M2 environment variable, e.g. export m2= $M 2_home/bin.
      4. Optional:add the MAVEN_OPTS environment variable to specify JVM properties, e.g. export maven_opts= "-xms256m-xmx512m". This environment variable can is used to supply extra options to Maven.
      5. ADD M2 environment variable to your path, e.g. export path= M 2 : PATH.
      6. Make sure this java_home is set to the location of the your JDK, e.g. export java_home= (/usR /l Ibex eC/J av a H ome?v1.8)aNd T haT Java_home/bin is in your PATH environment variable (although, might not being necessary with the latest MAC OS X versions and the Oracle JDK).
      7. Run mvn–version To verify the it is correctly installed.


Maven Install on Mac OS X


Related Article

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.