标签:.com 准备 local mirrors artifact apache cts download pre
一、需要准备的东西
1. JDK
2. Maven
二、Maven下载
1.下载地址:https://maven.apache.org/download.cgi
2. 文件解压 D:\Program Files\apache-maven-3.6.0
3. 新建环境变量 MAVEN_HOME,赋值 D:\Program Files\apache-maven-3.6.0
4. 编辑环境变量Path,追加%MAVEN_HOME%\bin\;
5. 至此,maven已经完成了安装,我们可以通过DOS命令检查一下我们是否安装成功:
三、Maven配置
1. 新建文件夹作为本地仓库:D:\Program Files\apache-maven-3.6.0\repo
2. 修改配置文件:D:\Program Files\apache-maven-3.6.0\conf\settings.xml
1 <!-- localRepository 2 | The path to the local repository maven will use to store artifacts. 3 | 4 | Default: ${user.home}/.m2/repository 5 <localRepository>/path/to/local/repo</localRepository> 6 --> 7 8 <localRepository>D:\Program Files\apache-maven-3.6.0\repo</localRepository>
3. 运行命令,查看是否配置成功
mvn help:system
4. 配置仓库镜像。由于国外的镜像速度不太好。阿里的还不错
<mirrors> <!-- 阿里云仓库 --> <mirror> <id>alimaven</id> <mirrorOf>*</mirrorOf> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/repositories/central/</url> </mirror> <!-- 中央仓库1 --> <mirror> <id>repo1</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://repo1.maven.org/maven2/</url> </mirror> <!-- 中央仓库2 --> <mirror> <id>repo2</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://repo2.maven.org/maven2/</url> </mirror> </mirrors>
标签:.com 准备 local mirrors artifact apache cts download pre
原文地址:https://www.cnblogs.com/KyleXu/p/9972042.html