centos安装maven3
今天公司同事对我说要在一台服务器上搭建maven,maven是是一个项目管理和构建自动化工具,我觉得应该跟svn和git差不多,如果要安装maven的话,是需要java支持的.下面来说下怎么安装maven.
系统:centos 5.5
需要的软件:jdk-7u21-linux-i586.rpm
apache-maven-3.0.5-bin.tar.gz
1.下载软件
wget --no-cookie --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" http://download.oracle.com/otn-pub/java/jdk/7u21-b11/jdk-7u21-linux-i586.rpm?AuthParam=1368682603_bf969311b18fc7bbd6f2b874a76c4c66
wget http://apache.fayea.com/apache-mirror/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
当然也可以使用下面地址来下载
wget http://download.slogra.com/java/jdk-7u21-linux-i586.rpm
wget http://download.slogra.com/apache_module/apache-maven-3.0.5-bin.tar.gz
2.安装jdk
mv jdk-7u21-linux-i586.rpm\?AuthParam\=1368682603_bf969311b18fc7bbd6f2b874a76c4c66 jdk-7u21-linux-i586.rpm
rpm -ivh jdk-7u21-linux-i586.rpm
vi /etc/profile
export JAVA_HOME=/usr/java/default
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile
java -version
3.安装maven
tar zxf apache-maven-3.0.5-bin.tar.gz
mv apache-maven-3.0.5 /usr/local/maven
vi /etc/profile
MAVEN_HOME=/usr/local/maven
export MAVEN_HOME
export PATH=${PATH}:${MAVEN_HOME}/bin
或者
export M3_HOME=/usr/local/maven
export PATH=${M3_HOME}/bin:${PATH}
source /etc/profile
mvn -version
可以看到maven的版本信息,说明安装成功了,好,闪人.
系统:centos 5.5
需要的软件:jdk-7u21-linux-i586.rpm
apache-maven-3.0.5-bin.tar.gz
1.下载软件
wget --no-cookie --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" http://download.oracle.com/otn-pub/java/jdk/7u21-b11/jdk-7u21-linux-i586.rpm?AuthParam=1368682603_bf969311b18fc7bbd6f2b874a76c4c66
wget http://apache.fayea.com/apache-mirror/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
当然也可以使用下面地址来下载
wget http://download.slogra.com/java/jdk-7u21-linux-i586.rpm
wget http://download.slogra.com/apache_module/apache-maven-3.0.5-bin.tar.gz
2.安装jdk
mv jdk-7u21-linux-i586.rpm\?AuthParam\=1368682603_bf969311b18fc7bbd6f2b874a76c4c66 jdk-7u21-linux-i586.rpm
rpm -ivh jdk-7u21-linux-i586.rpm
vi /etc/profile
export JAVA_HOME=/usr/java/default
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile
java -version
3.安装maven
tar zxf apache-maven-3.0.5-bin.tar.gz
mv apache-maven-3.0.5 /usr/local/maven
vi /etc/profile
MAVEN_HOME=/usr/local/maven
export MAVEN_HOME
export PATH=${PATH}:${MAVEN_HOME}/bin
或者
export M3_HOME=/usr/local/maven
export PATH=${M3_HOME}/bin:${PATH}
source /etc/profile
mvn -version
可以看到maven的版本信息,说明安装成功了,好,闪人.
评论: