原文:http://www.darrenfang.com/2013/12/install-maven-on-centos/
http://www.codeweblog.com/centos-6-6%E9%85%8D%E7%BD%AEmaven3/
http://my.oschina.net/jiangbianwanghai/blog/472939
http://www.cnblogs.com/xdp-gacl/tag/Maven学习总结/
http://blog.csdn.net/typa01_kk/article/details/49228873 (nexus---Maven仓库管理器安装)
http://www.cnblogs.com/dingyingsi/p/3776557.html (maven私服 nexus搭建)
Maven的下载地址是:http://maven.apache.org/download.cgi
安装Maven非常简单,只需要将下载的压缩文件解压就可以了。
wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar zxf apache-maven-3.3.9-bin.tar.gz
3.3.X的maven必须要jdk1.7以上;
2.2.X要用jdk1.6;
配置maven环境:
[root@localhost apache-maven-3.3.9]# vim /etc/profile
在最后修改相关配置如下:
export ANT_HOME=/usr/local/apache-ant-1.9.7
export MAVEN_HOME=/usr/local/apache-maven-3.3.9
export JAVA_HOME=/usr/java/jdk1.7.0_75
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$CLASSPATH
export PATH=$PATH:$JAVA_HOME/bin:${ANT_HOME}/bin:${MAVEN_HOME}/bin:$PATH
保存退出后运行下面的命令使配置生效,或者重启服务器生效。
source /etc/profile
验证版本
[root@localhost apache-maven-3.3.9]# mvn -v
通过mvn -v 命令可以查看到如下类似的信息则表示成功
[root@localhost apache-maven-3.3.9]# mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /usr/local/apache-maven-3.3.9
Java version: 1.7.0_75, vendor: Oracle Corporation
Java home: /usr/java/jdk1.7.0_75/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-504.el6.x86_64", arch: "amd64", family: "unix"