- 修改setting.xml 文件 ,写入阿里云的镜像文件配置
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
2. 官网上搜索你需要的jar 包:https://mvnrepository.com/
搜索jar 包,点击你所需要的,选择版本号
将方框里的代码复制到pom.xml 文件中,再刷新maven 项目,jar 报就会自动下载
如果使用以上的配置文件还是无法下载pom.xml 书写的一些依赖,则在pom.xml 文件中添加如下内容:
//阿里云搭建了一个国内镜像http://maven.aliyun.com,跑起来速度很快,可以进行配置
<repositories>
<repository>
<id>nexus-aliyun</id>
<name>nexus-aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>