Maven项目对象模型(POM),可以通过一小段描述信息来管理项目的构建,报告和文档的项目管理工具软件。
一、下载
1.idea中自带maven

2.https://maven.apache.org/download.cgi?Preferred=http%3A%2F%2Fmirrors.tuna.tsinghua.edu.cn%2Fapache%2F

二、配环境
系统变量中添加:
M2_HOME=C:\Program Files\Apache Software Foundation\apache-maven-3.2.5 M2=%M2_HOME%\bin MAVEN_OPTS=-Xms256m -Xmx512m
Path中添加:
%M2%
检验:打开cmd,输入mvn -v
三、settings.xml配置镜像和仓库
镜像:
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</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>net-cn</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://maven.net.cn/content/groups/public/</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>
<mirror>
<id>ibiblio</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</mirror>
<mirror>
<id>jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>JBossJBPM</id>
<mirrorOf>central</mirrorOf>
<name>JBossJBPM Repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
</mirror>
<mirror>
<id>antelink</id>
<mirrorOf>central</mirrorOf>
<name>antelink Repository</name>
<url>http://maven.antelink.com/content/repositories/central/</url>
</mirror>
<mirror>
<id>openkoala</id>
<mirrorOf>central</mirrorOf>
<name>openkoala Repository</name>
<url>http://nexus.openkoala.org/nexus/content/groups/Koala-release/</url>
</mirror>
<mirror>
<id>tmatesoft</id>
<mirrorOf>central</mirrorOf>
<name>tmatesoft Repository</name>
<url>http://maven.tmatesoft.com/content/groups/public/</url>
</mirror>
<mirror>
<id>mavensync</id>
<mirrorOf>central</mirrorOf>
<name>mavensync Repository</name>
<url>http://mavensync.zkoss.org/maven2/</url>
</mirror>
</mirrors>
本地仓库:
<localRepository>C:\za\software\IntelliJ IDEA 2019.3.3\plugins\maven\lib\maven_jar</localRepository>
四、IDEA设置Maven
File-Settings

五、新建项目

六、添加外部依赖
https://mvnrepository.com/

比如这个,粘到pom.xml里就行
原文:https://www.cnblogs.com/holaworld/p/12334174.html