maven的安装和配置
目录
- maven简单介绍
- win10系统安装
- linux安装maven(centos7)
maven简单介绍
win10系统安装
- 官网下载maven
- windows选择 Binary zip archive
- 下载完成后解压到对应目录,配置maven环境变量.
- 右击此电脑->属性->高级系统设置->环境变量->系统变量中添加(变量名为
MAVEN_HOME
,变量值为D:\apache-maven-3.5.2
->双击path添加%MAVEN_HOME%\bin
->确定
- 在对应文件夹内创建maven本地仓库
- 进入解压后的maven文件夹内->conf->编辑settings.xml文件
- 在标签中添加自己刚创建的maven本地仓库
D:\tools\repository
- 在标签内添加默认的JDK版本
JDK-1.8
true
1.8
1.8
1.8
1.8
- 在标签中添加国内镜像源,一般默认会从这几个开始下载,没有的话就回去中央仓库了
alimaven
central
aliyun maven
http://maven.aliyun.com/nexus/content/repositories/central/
repo1
central
Human Readable Name for this Mirror.
http://repo1.maven.org/maven2/
repo2
central
Human Readable Name for this Mirror.
http://repo2.maven.org/maven2/
linux安装maven(centos7)
- 在官网下载tar.gz的包,解压到服务器上
- 配置MAVNE_HOME->
vim /etc/profile
- 添加maven
export MAVEN_HOME=/usr/local/software/apache-maven-3.5.4
- 添加
export PATH=$MAVEN_HOME/bin:$PATH
- 重载环境变量
source /etc/profile
- 查看结果
mvn -v
- maven中setting.xml的配置和windows的类似。