win7[配置]
1. 下载 Maven
官方地址: http://maven.apache.org/download.cgi
image
解压并新建一个本地仓库文件夹
image
2. 配置本地仓库路径
image
- C:\apache-maven-3.5.2\conf\settings.xml
- line:46
- <localRepository>E:\MavenRepository</localRepository>
- line:160
- <mirror>
- <id>alimaven</id>
- <name>aliyun maven</name>
- <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
- <mirrorOf>central</mirrorOf>
- </mirror>
新建本地仓库目录 E:\MavenRepository
3. 配置 maven 环境变量
image
image
image
image
4. 在 IntelliJ IDEA 中配置 maven
打开 - File-Settings
image
5. 新建 maven web 项目
打开 - File-New-Project
点击 NEXT
image
点击 NEXT
image
添加的配置为 archetypeCatalog=internal
点击 NEXT
image
点击 NEXT
image
点击 Finish 后项目开始创建
点击右下角查看进去
image
6.maven Web 模板项目结构
image
image
image
7. 配置依赖 jar 包
image
jar 包配置搜索
官方地址: http://mvnrepository.com/
win10[配置]
第一步: 我的电脑 --- 右键属性 --- 高级系统设置 --- 环境变量 --
然后:
(https://upload-images.jianshu.io/upload_images/15384450-623757e8f48d5144.png?imageMogr2/auto-orient/strip|imageView2/2/w/1240)
在 path 中 添加全路径
第二步: 配置 Eclipse
Windows---references--Maven--User Settings
如图:
image.PNG
然后: Windows---references--Maven--Installations
image.PNG
记住:
image.PNG
来源: http://www.jianshu.com/p/0f6981b7dba8