ITeye博客

Mac OS 配置Maven

lonelythinker · 2015-02-05 14:59 · 开发杂记 · 编程语言 · maven · Markdown

步骤:

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. export MAVEN_HOME
  4. 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文件路径

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。