Skip to content

Commit f882607

Browse files
committed
更新脚本
1 parent 53614e4 commit f882607

4 files changed

Lines changed: 20 additions & 22 deletions

File tree

File renamed without changes.
Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
#!/usr/bin/env bash
22

3+
cat << EOF
34
###################################################################################
4-
# 安装 Maven 脚本
5+
# 安装 Maven3 脚本
56
# 适用于所有 linux 发行版本。
67
# Maven 会被安装到 /opt/maven 路径。
78
# 注意:Maven 要求必须先安装 JDK
89
# Author: Zhang Peng
910
###################################################################################
11+
EOF
1012

11-
echo -e "\n>>>>>>>>> install maven"
13+
version=3.6.0
14+
if [[ -n $1 ]]; then
15+
version=$1
16+
fi
17+
18+
root=/opt/maven
19+
if [[ -n $2 ]]; then
20+
root=$2
21+
fi
1222

13-
mkdir -p /opt/maven
14-
cd /opt/maven
23+
echo -e "\n>>>>>>>>> download maven"
24+
mkdir -p ${root}
25+
cd ${root}
1526

16-
version=3.5.4
17-
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
18-
tar -zxvf apache-maven-${version}-bin.tar.gz
27+
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" -O ${root}/apache-maven-${version}-bin.tar.gz http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/${version}/binaries/apache-maven-${version}-bin.tar.gz
28+
29+
echo -e "\n>>>>>>>>> install maven"
30+
tar -zxvf apache-maven-${version}-bin.tar.gz -C ${root}
1931

2032
# 设置环境变量
2133
cat >> /etc/profile << EOF
@@ -27,4 +39,4 @@ source /etc/profile
2739
# 备份并替换 settings.xml,使用 aliyun 镜像加速 maven
2840
echo -e "\n>>>>>>>>> replace /opt/maven/apache-maven-${version}/conf/settings.xml"
2941
cp /opt/maven/apache-maven-${version}/conf/settings.xml /opt/maven/apache-maven-${version}/conf/settings.xml.bak
30-
wget -N https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven/settings-aliyun.xml -O /opt/maven/apache-maven-${version}/conf/settings.xml
42+
wget -N https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/config/settings-aliyun.xml -O /opt/maven/apache-maven-${version}/conf/settings.xml

codes/linux/ops/soft/maven/README.md

Lines changed: 0 additions & 14 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)