Getting started with Maven on a Mac

Source: Internet
Author: User

The first blogger is also in the introductory study, in learning Maven encountered a lot of problems. Check the data found that the use of online maven is mostly win, so I am going to write some maven in the introduction of Mac notes, hope to help you as I have difficulties.

1, http://maven.apache.org/download.html

First go to the official website to download the latest version of Maven, such as apache-maven-3.3.3-bin.tar.gz, and then extract to the local directory (/usr/local/).

2. Next, we need to set the M2_HOME environment variable to point to apache-maven-3.3.3, and add the bin/folder under the MAVEN installation directory to the System environment variable path (prior to configuring the Java_home):

Vim opens the/etc/profile file by adding the following code:

Export m2_home=/users/wanyakun/documents/apache-maven-3.3.3

Export path= $PATH: $M 2_home/bin

The installation was done to this rescue.

3. Let's check if the installation is successful.

Mvn-version

localhost:~ nwl$ mvn-version

Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22t19:57:37+08:00)

Maven Home:/usr/local/apache-maven-3.3.3

Java version:1.7.0_79, Vendor:oracle Corporation

Java Home:/library/java/javavirtualmachines/jdk1.7.0_79.jdk/contents/home/jre

Default LOCALE:ZH_CN, Platform Encoding:utf-8

OS name: "Mac OS X", Version: "10.10.5", Arch: "X86_64", Family: "Mac"

Now let's talk about Maven's use:

4. Create a project

Switch to the root directory of the MAVEN project (not the installation directory). CD /users/nwl/documents/apache-maven-3.3.3.

MVN Archetype:create-dgroupid=edu.zju.cst.myproject-dartifactid=repo (the first compilation will take a long time, please wait patiently).

Getting started with Maven on a 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.