Mac电脑maven安装与配置
1.下载:
http://maven.apache.org/download.cgi
2.安装:
解压下载好的maven的文件,解压到你想要的文件夹下。
3.配置:
打开终端输入命令
sudo vim ~/.bash_profile
(编辑环境变量配置文件)
在环境变量文件中加上如下的配置export MAVEN_HOME=maven文件夹路径
export MAVEN_HOME=/Users/dorsey/Downloads/apache-maven-3.6.3
export PATH=$PATH:$MAVEN_HOME/bin
:wq退出并保存当前文件
`source .bash_profile`
按下Enter键使bash_profile生效。
mvn -v,结果如下图内容即表明配置成功
mvn -v
pache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /Users/dorsey/Downloads/apache-maven-3.6.3
Java version: 1.8.0_271, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: “mac os x”, version: “10.14.4”, arch: “x86_64”, family: “mac”
4.配置阿里云镜像
settings.xml文件里面配置
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
-->
</mirrors>