2022 官方文档部署 MAVEN 最新最全

确保 JDK 安装无误
一、百度输入关键字 maven,选择官网,进入官网


二、找到下载位置,如图所示,双击进入

三、找到下载位置(下载的是安装包 bin 版本的,src 是源码查看),双击下载

四、弹出保存框,选择你要保存的位置

五、解压文件,得到如下文件


六、打开配置文件目录,备份配置文件
配置文件需要备份,否则,操作错误,就没办法重新配置了。

七、修改配置文件 settings
打开配置文件 settings,配置本地仓库,就是从网站上下载的 jar 存放位置。

默认<localRepository>是注释的,这里需要时起生效
复制代码
配置私服地址,就是 maven 从哪个服务器往本地下载 jar 包,一般选择阿里服务器
复制代码
配置 maven 备用的仓库,就是在阿里云下载不到的 jar 包,就会去这个路径下载,这里配置的事 spring 仓库,阿里云仓库目前有些 spring 的 jar 无法很好的下载
复制代码
八、配置环境变量(windows7 或 windows10)
选择控制面板

选择系统和安全

选择系统
选择高级系统设置

选择高级-->环境变量

选择系统变量,然后点击新建

填入信息

在系统变量里找到 path,双击打开

填入如下信息,windows7 需要用逗号隔开
复制代码

九、测试安装成功
验证是否配置好环境,win+R,输入 cmd,进入命令窗口.

输入命令,如果出现如图情况,即为安装成功
复制代码

版权声明: 本文为 InfoQ 作者【北极的大企鹅】的原创文章。
原文链接:【http://xie.infoq.cn/article/8a754a1a46ddfbfc0f881b014】。未经作者许可,禁止转载。
评论