mvnrepository.com 中央仓库 老外的 网速不好
互联网 有N个仓库(是主要的)把中央仓库的东西下载到本地仓库
本地仓库 (程序员电脑)localRepository
boot 引导下载 里面有个包 bin maven 命令
conf 配置器 lib 仓库
archetypeCatalog internal
https://github.com 中央控制器
Maven 配置步骤
1 .下载 网址 zip压缩文件
http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.4/binaries/
2.解压
3.修改 apache-maven-3.5.4\conf\settings.xml 下的文件
<localRepository>放自动编译的文件路经</localRepository>
要在maven的settings.xml 文件里配置mirrors的子节点,添加如下mirror
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
4.配置eclipse
window -》 prefernces -》 Maven -》 installations -》add
window -》 prefernces -》 Maven -》 User Settings-》User Settings
创建 Maven项目
5 配置 pom.xml
复制
<!-- 依赖导包 -->
<dependencies>
<!-- 引用单元测试 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- 引用servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>