首页 > 代码库 > mac下搭建maven环境
mac下搭建maven环境
1:首先从官网下载压缩包:
URL: http://maven.apache.org
2:解压缩配置文件:
topwqp:Documents wangqiupeng$ tar -zxvf apache-maven-3.2.3-bin.tar.gz
解压后的目录结构如下:
topwqp:apache-maven-3.2.3 wangqiupeng$ ls
LICENSE README.txtboot lib
NOTICE binconf
LICENSE README.txtboot lib
NOTICE binconf
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
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
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安装成功
refer: http://blog.csdn.net/anialy/article/details/22217937
mac下搭建maven环境
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。