Check Java_home environment variables
C:\users\administrator>echo%java_home%
Unzip the MAVEN Core program installation package and place it in a non-Chinese path without spaces
D:\apache-maven-3.5.0-bin
Configuring the environment variables for MAVEN
① configuration Maven_home or M2_home
Configure M2_home to D:\apache-maven-3.5.0-bin\conf
Add D:\apache-maven-3.5.0-bin\bin under Path (contains bin)
② Verify: Run the mvn-v command to view MAVEN version information
650) this.width=650; "title=" 4@pxz_i%p_ ' T3~4c0x%xmo6.png "src=" https://s2.51cto.com/oss/201710/25/ A513376016ffda9bd2984a03b1694eaf.png-wh_500x0-wm_3-wmp_4-s_2768596520.png "alt=" A513376016ffda9bd2984a03b1694eaf.png-wh_ "/>
Setting up the MAVEN local core repository
① Copy D:\apache-maven-3.5.0-bin\conf\settings.xml Path
② Add <localRepository>D:\RepMaven</localRepository> Tag
Using Maven in Eclipse
①maven plugin: Eclipse built-in
②maven Plugin Settings
[1]installations: Specifies the location of the MAVEN core program and does not recommend the use of the own MAVEN program, but instead uses the self-extracting MAVEN program
[2]user setting specifies the location of the Conf/setting.xml to obtain the local location of the central warehouse
Set Maven to use JDK version by default
① Open D:\apache-maven-3.5.0-bin\conf\settings.xml
Add in ②<profiles></profiles>
<profile> <id>jdk1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </ activation> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</ maven.compiler.target> < maven.compiler.compilerversion>1.8</maven.compiler.compilerversion> </properties> &nbSp; </profile>
Eclipse Configuration Maven