1,下载
浏览器搜索 Maven 进入官网进行下载。
2,解压
3,设置本地仓库位置
点击 conf 打开 settings.xml 文件进行设置,下面是我修改的简化版
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- 本地仓库路径,默认路径为${user.home}/.m2/repository -->
<localRepository>E:\2018ZhengTong\apache-maven-3.5.4\repository</localRepository>
<!-- 互动模式,默认值为true。该值使用默认值即可,无需更改 -->
<interactiveMode>true</interactiveMode>
<!-- 离线模式,默认值为false。当因为各种原因无法与远程仓库连接时,可将该值修改为true -->
<offline>false</offline>
<!-- 插件组 -->
<pluginGroups></pluginGroups>
<!-- 代理设置 -->
<proxies></proxies>
<servers></servers>
<!-- 镜像仓库,内部由n个mirror节点组成。用来代替中央仓库(Maven默认的远程仓库),用于提升传输速度 -->
<mirrors>
<mirror>
<id>central</id>
<url>http://127.0.0.1:8081/nexus/content/groups/public</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<!-- 用于覆盖在一个POM或者profiles.xml文件中的任何相同id的profiles节点 -->
<profiles></profiles>
<!-- activeProfile值为profile中所定义的id,在这里定义的activeProfile总是被激活 -->
<activeProfiles></activeProfiles>
</settings>
4,配置环境变量
MAVEN_HOME = E:\2018ZhengTong\apache-maven-3.5.4
PATH = %MAVEN_HOME%\bin
5,eclipse 设置 Maven
完结