2018-02-01 16:34:02 +08:00
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2018-02-23 17:33:12 +08:00
|
|
|
|
###################################################################################
|
|
|
|
|
# 安装 Maven 脚本
|
|
|
|
|
# 适用于所有 linux 发行版本。
|
2018-09-29 10:16:24 +08:00
|
|
|
|
# Maven 会被安装到 /opt/maven 路径。
|
2018-02-23 17:33:12 +08:00
|
|
|
|
# 注意:Maven 要求必须先安装 JDK
|
|
|
|
|
# Author: Zhang Peng
|
|
|
|
|
###################################################################################
|
|
|
|
|
|
2018-02-01 16:34:02 +08:00
|
|
|
|
echo -e "\n>>>>>>>>> install maven"
|
|
|
|
|
|
2018-09-29 10:16:24 +08:00
|
|
|
|
mkdir -p /opt/maven
|
|
|
|
|
cd /opt/maven
|
2018-02-01 16:34:02 +08:00
|
|
|
|
|
2018-07-16 19:16:39 +08:00
|
|
|
|
version=3.2.5
|
2018-02-02 17:53:50 +08:00
|
|
|
|
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/${version}/binaries/apache-maven-${version}-bin.tar.gz
|
2018-02-01 16:34:02 +08:00
|
|
|
|
tar -zxvf apache-maven-${version}-bin.tar.gz
|
2018-02-02 17:53:50 +08:00
|
|
|
|
|
|
|
|
|
cat >> /etc/profile << EOF
|
2018-09-29 10:16:24 +08:00
|
|
|
|
export MAVEN_HOME=/opt/maven/apache-maven-${version}
|
2018-02-23 17:33:12 +08:00
|
|
|
|
export PATH=\$MAVEN_HOME/bin:\$PATH
|
2018-02-02 17:53:50 +08:00
|
|
|
|
EOF
|
|
|
|
|
source /etc/profile
|