资源规划
组件 | bigdata-node1 | bigdata-node2 | bigdata-node3 |
---|---|---|---|
OS | redhat-8.2 | redhat-8.2 | redhat-8.2 |
JDK | jvm | jvm | jvm |
Maven | mvn | N.A | N.A |
安装介质
版本:apache-maven-3.3.9-bin.tar.gz
下载:https://archive.apache.org/dist/maven/maven-3
环境准备
安装JDK
参考:《RedHat-安装JDK-1.8.221》
安装Maven
cd /share
wget https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar -zxvf apache-maven-3.3.9-bin.tar.gz -C ~/modules/
rm apache-maven-3.3.9-bin.tar.gz
环境变量配置
vi ~/.bashrc # :$到达行尾添加
配置如下:
export MAVEN_HOME=/home/vagrant/modules/apache-maven-3.3.9
export PATH=$MAVEN_HOME/bin:$PATH
环境变量生效:
source ~/.bashrc
# 验证
mvn -v
配置本地仓库
mkdir -p /home/vagrant/repository339
vi ~/modules/apache-maven-3.3.9/conf/settings.xml
配置如下:
<localRepository>/home/vagrant/repository339</localRepository>
配置阿里云镜像
配置${M2_HOME}/conf目录下的settings.xml,内容太多,建议下载到本地修改后再提交。
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
常用操作
mvn clean install -DskipTests -Dfast