一、官网下载
官网地址 https://maven.apache.org/download.cgi
我下载的时候的版本是3.8.3
二、解压并移动到本地目录
解压文件,得到maven文件夹
三、修改zsh文件
(base) blog.csdn.net/diandianxiyu_geek@bogon ~ % vim .zshrc
(写入配置)
(base) blog.csdn.net/diandianxiyu_geek@bogon ~ % source ~/.zshrc
配置如下,需要配置自己的文件夹,不能直接套用。
export M2_HOME=/Users/blog.csdn.net/diandianxiyu_geek/code/apache-maven-3.8.3
export PATH=$PATH:$M2_HOME/bin**
四、安装完成
(base) blog.csdn.net/diandianxiyu_geek@bogon ~ % mvn -v
Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
Maven home: /Users/lixiaoyu/code/apache-maven-3.8.3
Java version: 17, vendor: Oracle Corporation, runtime: /Users/lixiaoyu/Library/Java/JavaVirtualMachines/openjdk-17/Contents/Home
Default locale: zh_CN_#Hans, platform encoding: UTF-8
OS name: "mac os x", version: "11.4", arch: "x86_64", family: "mac"