`
lonelythinker
  • 浏览: 27522 次
  • 性别: Icon_minigender_1
  • 来自: 石家庄
社区版块
存档分类
最新评论

Mac OS 配置Maven

阅读更多

步骤:

1. 下载Maven tar包

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

 

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

 

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

 

 

 

3. 创建环境变量

cd 到根路径, cd ~

新建文件

 

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


修改

 

 

[plain] view plaincopy在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 plaincopy在CODE上查看代码片派生到我的代码片
 
  1. source .bash_profile  

 

 

5. 查看Maven是否安装成功

 

6. 为eclipse建立独立Repository

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

 

[html] view plaincopy在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文件路径

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics