安装maven
将apache-maven-3.6.1-bin.tar.gz上传至该software目录下
解压:tar -xvf apache-maven-3.6.1-bin.tar.gz
vim /etc/profile 新增以下内容
#maven
export MAVEN_HOME=/home/resources/apache-maven-3.6.1
export PATH=$MAVEN_HOME/bin:$PATH
配置本地仓库位置
- cd apache-maven-3.6.1/
- mkdir ck(本地仓库名称,自定义)
- vim conf/settings.xml,配置本地仓库路径
<localRepository>/home/software/apache-maven-3.6.1/ck</localRepository>
配置阿里云镜像
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
验证是否安装成功:mvn -v
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-05T03:00:29+08:00)
Maven home: /home/resources/apache-maven-3.6.1
Java version: 1.8.0_251, vendor: Oracle Corporation, runtime: /home/software/jdk1.8.0_251/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-514.el7.x86_64", arch: "amd64", family: "unix"