centos环境下,maven的安装以及在eclipse中的配置(2017/07/06)

来源:互联网 发布:windows 获取最高权限 编辑:程序博客网 时间:2024/05/29 18:23

1、从maven官网下载apache-maven-3.5.0-bin.tar.gz,解压到指定的路径下。

2、在root权限下执行:

vim /etc/profile

添加(为maven配置环境变量):

export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export M2_HOME=/usr/local/apache-maven-3.5.0

3、执行:

source /etc/profile

使得环境变量文件生效。

4、打开eclipse,在window——>preferences内:

(1)找到maven——>installations,点击add,添加maven的安装路径;

(2)在User Settings内,将global settings/user settings配置为…/apache-maven-3.5.0/conf/settings.xml(即maven安装路径下找到settings.xml文件);

5、完美。微笑微笑微笑