linux下安装Maven
tar -zxvf apache-maven-3.5.3-bin.tar.gz -C /opt
修改环境变量 vim /etc/profile
export MAVEN_HOME="/opt/apache-maven-3.5.3"
export PATH=$MAVEN_HOME/bin:$PATH
source /etc/profile
创建本地仓库及配置settings文件
mkdir /opt/maven-repository
gedit /opt/apache-maven-3.5.3/conf/settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>/opt/maven-repository</localRepository>
<offline>false</offline>
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>alimaven</id>
<repositories>
<repository>
<id>alimaven</id>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</repository>
</repositories>
</profile>
<profile>
<id>genesis</id>
<repositories>
<repository>
<id>genesis</id>
<url>http://genesis.ugent.be/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>alimaven</activeProfile>
<activeProfile>genesis</activeProfile>
</activeProfiles>
</settings>