安装配置流程
前提: 已经配置好java环境
传送门:Linux 安装jdk1.8
1、下载maven源码(根据自己的需要的版本下载)
ps:如果速度较慢可以挂梯子下载再上传到对应目录
wget https://archive.apache.org/dist/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz
2、解压
tar -zxvf apache-maven-3.6.1-bin.tar.gz
3、配置maven环境变量并更新配置
leafpad /root/.bashrc
export MAVEN_HOME=/usr/local/apache-maven-3.6.1
export M2_HOME=/usr/local/apache-maven-3.6.1/bin
export PATH=${MAVEN_HOME}/bin:$PATH
source /root/.bashrc
4、验证
mvn -version
5、配置maven的阿里云远程仓库地址
leafpad apache-maven-3.6.1/conf/settings.xml
在mirror中添加如下内容
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*,!jeecg,!jeecg-snapshots</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
6、配置maven本地仓库地址
leafpad apache-maven-3.6.1/conf/settings.xml
复制注释的localRepository一份,并更改为如下内容
<localRepository>/usr/local/apache-maven-3.6.1/repo</localRepository>