1.从官网下载apache-maven-3.3.1的tar gz包
2.解压apache-maven-3.3.1.tar.gz包
</pre><pre name="code" class="plain"># tar -xzf apache-maven-3.3.1.tar.gz
# mv apache-maven-3.3.1 /usr/local/
#vim /etc/profile
配置如下:
export MAVEN_HOME=/usr/local/apache-maven-3.3.1export JAVA_HOME=/usr/local/jdk17
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH
4.测试maven的环境
#mvn -v
显示信息如下:
Apache Maven 3.3.1 (cab6659f9874fa96462afef40fcf6bc033d58c1c; 2015-03-14T04:10:27+08:00)
Maven home: /usr/local/apache-maven-3.3.1Java version: 1.7.0_17, vendor: Oracle Corporation
Java home: /usr/local/jdk17/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-431.el6.x86_64", arch: "amd64", family: "unix"