https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/
apache-maven-3.6.3-bin.tar.gz
/usr/local/
配置Maven环境变量,批改/etc/profile文件,追加以下内容到文件最初。
/etc/profile
# Maven MAVEN_HOME=/usr/local/apache-maven-3.6.3 export PATH=${MAVEN_HOME}/bin:${PATH}
其中MAVEN_HOME=后的/usr/local/apache-maven-3.6.3更换为本人解压的maven目录门路。
MAVEN_HOME=
/usr/local/apache-maven-3.6.3
source /etc/profile
验证Maven环境是否筹备实现,mvn -v,如果呈现相似以下内容,即示意胜利。
mvn -v
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /usr/local/apache-maven-3.6.3 Java version: 1.8.0_202, vendor: Oracle Corporation, runtime: /usr/local/java/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "linux", version: "3.10.0-1160.el7.x86_64", arch: "amd64", family: "unix"
配置maven国内镜像、指定jdk编译版本。进入maven根目录/conf,编辑文件settings.xml。减少以下内容:
maven根目录/conf
settings.xml
alimaven aliyun maven http://maven.aliyun.com/nexus/content/groups/public/ central jdk-1.8 true 1.8 1.8 1.8 1.8
留神要加到对应的地位,例如相干的配置就搜寻,加到中,而也是同理。