linux yum安装maven
安装maven
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo yum -y install apache-maven
查看maven home
mvn -v

配置环境变量
vi /etc/profile
重载环境变量
source /etc/profile
替换maven源,阿里云的源
vim /etc/maven/settings.xml
找到<mirrors></mirrors>标签对,添加一下代码:
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
指定下载资源位置
<localRepository>/usr/local/maven/repository</localRepository>
指定JDK版本
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
本文来自博客园,作者:void_main(),转载请注明原文链接:https://www.cnblogs.com/void--main/p/17774811.html

浙公网安备 33010602011771号