Mac OS 配置Maven

简述:

在Mac OS上配置Maven

参考:http://blog.sina.com.cn/s/blog_67f81bad0100r5lk.html

 

步骤:

1. 下载Maven tar包

http://maven.apache.org/download.cgi

 

2. 下载后解压到某个文件夹下

 

[html]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. /Users/xuchen/Desktop/dev/applications/maven/apache-maven-3.2.1  

 

 

3. 创建环境变量

cd 到根路径, cd ~

新建文件

 

[html]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. vi .bash_profile  


修改

 

 

[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. MAVEN_HOME=/Users/xuchen/Desktop/dev/applications/maven/apache-maven-3.2.1  
  2. PATH=$PATH:$MAVEN_HOME/bin  
  3.   
  4. export MAVEN_HOME  
  5. export PATH  

 

4. 使配置文件生效

 

[html]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. source .bash_profile  

 

5. 查看Maven是否安装成功

 

6. 为eclipse建立独立Repository

新建一个文件夹作为repository的根目录, 将setting文件加入

 

[html]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. <localRepository>/Users/xuchen/Desktop/dev/applications/maven/repository/anialy-repo</localRepository>  



 

 

 

7. 之后在eclipse中安装m2eclipse插件(在marketplace可找到)

安装完成后在Preference中就能够看到, 

 

 

8. 配置setting

preference -> maven -> installation, 选择之前解压出来的maven文件路径

 

 

之后,进入User Setting 设置setting.xml文件路径

猜你喜欢

转载自youyanweixiao.iteye.com/blog/2230271