1、配置系统变量
MAVEN_HOME=D:\apache-maven-3.6.1
M2=%MAVEN_HOME%\bin
MAVEN_OPTS=-Xms256m -Xmx512m
2、配置setting.xml文件
<localRepository>D:\apache-maven-3.6.1\repository</localRepository>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
<mirror>
<id>ui</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://uk.maven.org/maven2/</url>
</mirror>
3、配置idea,如果报下面的错,注意把work office去掉勾
Non-resolvable parent POM for com.webserver:manage:1.0: Cannot access alimaven (http://maven.aliyun.com/nexus/content/groups/public/) in offline mode and the artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.0.RELEASE has not been downloaded from it before. and 'parent.relativePath' points at no local POM @ line 5, column 13