Maven的作用是来管理项目依赖构件(jar包)
1. 下载Maven
官方地址:http://maven.apache.org/download.cgi

- 解压并新建一个本地库文件夹E:\MavenRepository
3.在settings.xml中配置本地仓库路径及国内镜像服务器地址
image.png
Maven国内镜像仓库:
http://maven.aliyun.com/nexus/content/groups/public
配置本地mevan下载文件夹
<localRepository>E:\MavenRepository</localRepository>
配置镜像文件
<mirrors>
<!--
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</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>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>jdk-1.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>
</profile>
</profiles>
4.在IntelliJ IDEA中配置maven
打开-File-Settings

5.新建maven WEB项目
打开-File-New-Project
点击NEXT

点击NEXT

添加的配置为 archetypeCatalog=internal
点击NEXT

点击NEXT

点击Finish后项目开始创建
点击右下角查看进去

6.maven web模板项目结构



7.配置依赖jar包

jar包配置搜索
官方地址:http://mvnrepository.com/
网友评论