1. Configure MAVEN to check settings for the following Java environment variables. Need to check Java_home environment variables and Java commands
$ echo $JAVA _home
/library/java/javavirtualmachines/jdk1.8.0_66.jdk/contents/home
$ java-version
Java Version "1.8.0_66"
Java (TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot (TM) 64-bit Server VM (build 25.66-b17, Mixed mode)
2.
Then go to http://maven.apache.org/download.html to download the MAVEN installation files, such as apache-maven-3.3.9-bin.tar.gz, then unzip to the local directory
Next, we need to set the M2_HOME environment variable to point to apache-maven-3.3.9, and add the bin/folder under the MAVEN installation directory to the system environment variable path:
Vim opens the ~/.bash_profile file by adding the following code:
Export M2_home= here Write the installation path/apache-maven-3.3.9
Export path= $PATH: $M 2_home/bin
Now that the installation is complete, we can run the following command to check the MAVEN installation:
$ echo $M 2_home
$ mvn-version
Apache Maven 3.3.9 (BB52D8502B132EC0A5A3F4C09453C07478323DC5; 2015-11-11t00:41:47+08:00)
Maven Home:/users//data/soft/apache-maven-3.3.9
Java version:1.8.0_66, Vendor:oracle Corporation
Java Home:/library/java/javavirtualmachines/jdk1.8.0_66.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"
3. Install the Eclipse plugin M2eclipse
- Open Eclipse, select Help->install New software
- Click
Add...
HTTP://M2ECLIPSE.SONATYPE.ORG/SITES/M2E
- Click OK to wait for the installation to complete
Installation verification:
Restart Eclipse, help-about eclipse-installation Details
In the Installed Software tab, check that the module you just selected is in this list
Check to see if Eclipse has supported the creation of MAVEN projects:
File-to--and other, find Maven, and if it's all right, it means that M2eclipse is properly installed.
4 Maven Project Import
-
- Import in Eclipse selects the MAVEN project that already exists,
Eclipse Import Maven Project
- Select the project you want to import, click Finish
Mac builds maven and Eclipse development environment