maven配置镜像更新后出现错误
org.apache.maven.plugins:maven-surefire-plugin:2.12.4
org.apache.maven.plugins:maven-resources-plugin:2.6
org.apache.maven.plugins:maven-jar-plugin:2.4
org.apache.maven.plugins:maven-compiler-plugin:3.1
这个一般都是下载插件出现问题了,建议使用阿里云的镜像源
找到Maven的settings.xml文件,该文件通常位于Maven安装目录的conf目录下。
在settings.xml文件中找到元素,如果该元素不存在,则可以手动添加。示例:
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
然后重新更新一下
maven reimport 看看有没什么错误
保证Idea maven配置走的是自定义的maven配置后,pom.xml右键 -> Maven -> Reload Project
在
<mirrors>
标签下添加<mirror>
,配置一个国内镜像源,用于加速jar
包的下载。下面示例代码为阿里云的镜像源。
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>