赞
踩
下载 .tar.gz结尾的压缩包
cd /usr/local
mkdir maven
使用Xftp 6即可轻松上传
tar xzf apache-maven-3.6.3-bin.tar.gz
vi /etc/profile
添加下面两行代码
- MAVEN_HOME=/usr/local/maven/apache-maven-3.6.3
- export PATH=${MAVEN_HOME}/bin:${PATH}
重新加载环境变量
source /etc/profile
mvn -v
若输出以下内容表明安装成功
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/maven/apache-maven-3.6.3
Java version: 1.8.0_242, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el8_1.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: “linux”, version: “4.18.0-147.5.1.el8_1.x86_64”, arch: “amd64”, family: “unix”
打开配置文件
vim /usr/local/maven/apache-maven-3.6.3/conf/settings.xml
按下 insert 开始插入,修改完之后输入 :wq 安全退出
mirros标签添加一下代码
- <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>
在maven目录创建repository文件夹
<localRepository>/usr/local/maven/repository</localRepository>
按下ESC,输入:wq退出
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。