mac下搭建maven环境


1:首先从官网下载压缩包:

2:解压缩配置文件:
topwqp:Documents wangqiupeng$ tar -zxvf apache-maven-3.2.3-bin.tar.gz 
解压后的目录结构如下:
topwqp:apache-maven-3.2.3 wangqiupeng$ ls
LICENSE README.txt boot lib
NOTICE bin conf

3:添加到环境变量PATH中
topwqp:~ wangqiupeng$ vi .bash_profile
填充内容如下:
MAVEN_HOME=/Users/wangqiupeng/Documents/apache-maven-3.2.3
PATH=$PATH:$MAVEN_HOME/bin

export MAVEN_HOME
export PATH
~                     

4:使配置文件生效:
topwqp:~ wangqiupeng$ source .bash_profile 

5:查看maven是否安装成功:
topwqp:~ wangqiupeng$ mvn -v
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T04:58:10+08:00)
Maven home: /Users/wangqiupeng/Documents/apache-maven-3.2.3
Java version: 1.6.0_65, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: zh_CN, platform encoding: EUC_CN
OS name: "mac os x", version: "10.10", arch: "x86_64", family: "mac"

6:ok以上证明maven安装成功

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。