https://www.wulaoer.org/?p=487,配置maven之前需要先下载软件:https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/
[wolf@wulaoer.org🔥🔥🔥🔥 ~]# tar -zxf apache-maven-3.8.5-bin.tar.gz [wolf@wulaoer.org🔥🔥🔥🔥 ~]# ls /usr/local/ aegis bin cloudmonitor etc games go include jdk lib lib64 libexec maven n nginx node sbin share src [wolf@wulaoer.org🔥🔥🔥🔥 ~]# mv apache-maven-3.8.5 /usr/local/maven
文件已下载,下面就需要配置环境变量了,有习惯配置在~/.bashrc文件中,我一般都会在/etc/profile文件中,看一下我的配置内容:
[wolf@wulaoer.org🔥🔥🔥🔥 ~]# vim /etc/profile .......... export JAVA_HOME=/usr/local/jdk export M2_HOME=/usr/local/maven export JRE_HOME=$JAVA_HOME/jre export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$M2_HOME/bin [wolf@wulaoer.org🔥🔥🔥🔥 ~]# source /etc/profile [wolf@wulaoer.org🔥🔥🔥🔥 ~]# mvn -version Apache Maven 3.8.5 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) Maven home: /usr/local/maven Java version: 1.8.0_221, vendor: Oracle Corporation, runtime: /usr/local/jdk/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.10.0-1160.25.1.el7.x86_64", arch: "amd64", family: "unix"
您可以选择一种方式赞助本站
支付宝扫一扫赞助
微信钱包扫描赞助
赏