下载:
https://archive.apache.org/dist/maven/maven-3/3.6.1/binaries/
环境
vim ~/.zshrc
# 写入
export MAVEN_HOME=/Users/Goku/develop/Software/apache-maven-3.6.1
export PATH=$PATH:$MAVEN_HOME/bin
# 更新环境变量配置
source ~/.zshrc
# 测试
mvn -v
# 配置本地仓库
cd /Users/Goku/develop/Software/apache-maven-3.6.1
mkdir repository
# 修改自定义的本地仓库地址
vim /Users/Goku/develop/Software/apache-maven-3.6.1/conf/settings.xml
# 修改本地的仓库地址
<localRepository> /Users/Goku/develop/Software/apache-maven-3.6.1/repository </localRepository>
镜像
shift+opt+f 代码整理vscode
<!-- 阿里云仓库 -->
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
配置jdk1.8
<profile>
<id>jdk1.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>
中央仓库下载文件到本地库
mvn help:system
成功效果如下:
配置Intellij IDEA
打开IntelliJ IDEA:
Preference->Build->Build Tools->Maven