一、Maven安装配置(eclipse)
eclipse在线安装
打开Eclipse的Help->Install New Software,如下图所示:
点击Add...
输入要下载的插件地址
Name: m2e
Location: http://download.eclipse.org/technology/m2e
勾选要下载的项,点击next进行下载。
安装maven时一定要注意版本匹配问题:
安装maven时遇到Missing requirement: m2e logback configuration 1.7.0.20160603-1933 (org.eclipse.m2e.logback.configur。。。的问题。
这是由于eclipse和maven插件版本不匹配,低版本的话可以指定安装版本
所以下载的版本路径参考:http://www.eclipse.org/m2e/m2e-downloads.html
例如安装m2e - http://download.eclipse.org/technology/m2e/releases/1.3的版本
离线安装
首先在eclipse 安装根目录下 新建两个文件夹 links 和 myplugins
D:\eclipse\links和D:\eclipse\myplugins
links 放置插件的软连接
myplugins 放置插件的文件
在myplugins 下新建mavenPlugins 文件夹
将下载下来的eclipse-maven3-plugin放到myplugins;
在links 下新建 maven.link 文件,在文件中添加内容path=D:/eclipse/myplugins/mavenPlugins
完成后重启eclipse
配置maven变量
将下载好的解压到D:\apache-maven-3.0.4(下载地址 http://maven.apache.org/download.cgi)
配置环境变量
变量名: MAVEN_HOME
变量值: D:\apache-maven-3.0.4
Path最后添加;%MAVEN_HOME%\bin
cmd执行mvn --version命令
显示版本表示已经安装成功
修改D:\apache-maven-3.0.4\conf下的settings配置文件
settings文件中加入这样一句话:<localRepository>D:\Repositories\Maven</localRepository>,然后保存
打开eclipse-->preferences 选择 Maven 下面的Installations,点击添加选择apache-maven-3.0.4的安装路径,如图
选择 Maven 下面的User Settings,选择本地的setting.xml
以上就是配置的全过程