-
官网下载maven安装包并解压
https://www.apache.org/ -
修改conf/settings.xml切换mirror源
<!-- 切换mirror源 --> <mirror> <id>nexus-aliyun</id> <mirrorOf>central</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> </mirror> -
修改conf/settings.xml添加profile
<!-- 添加profile --> <profile> <id>jdk-1.8</id> <activation> <jdk>1.8</jdk> </activation> <repositories> <repository> <id>nexus</id> <name>local private nexus</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>local private nexus</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> -
配置系统环境变量
// 添加MAVEN_HOME MAVEN_HOME=D:\softwares\develop\apache-maven-3.8.1 // 添加path路径 %MAVEN_HOME%\bin -
命令行查看安装结果
mvn -version -
修改idea配置
Settings-Build, Execution, Deployment-Build Tools-Maven
配置maven环境并切换镜像源
于 2021-06-16 13:48:42 首次发布
本文指导如何从官网下载并配置Apache Maven,包括修改settings.xml切换镜像源和添加profile,以及设置环境变量和IDEA配置。重点讲解了如何为不同JDK版本设置本地私有Nexus仓库。

2059

被折叠的 条评论
为什么被折叠?



