安装Apache Maven

Maven是Java中的一个项目构建工具。

1.下载Maven

Maven下载页面:https://maven.apache.org/download.cgi

1
wget https://downloads.apache.org/maven/maven-3/3.8.2/binaries/apache-maven-3.8.2-bin.tar.gz

2.解压

1
tar -zxf apache-maven-3.8.2-bin.tar.gz -C /usr/local/

3.将bin添加到环境变量PATH中

1
vim ~/.bash_profile

添加如下内容:

1
export PATH=/usr/local/apache-maven-3.8.2/bin:$PATH

4.验证安装是否成功

1
2
3
4
5
6
hgs-2:blog-backup hegongshan$ mvn --version
Apache Maven 3.8.2 (ea98e05a04480131370aa0c110b8c54cf726c06f)
Maven home: /usr/local/apache-maven-3.8.2
Java version: 1.8.0_192, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.6", arch: "x86_64", family: "mac"

----------本文结束感谢您的阅读----------
坚持原创技术分享,您的支持将鼓励我继续创作!