之前记得写过一遍文章。很详细的。现在发现不在了。就只有遇到一点就来添加一点了、
创建maven项目抛出异常 和 下载jar包异常
故障不好重现,大体的映像是:创建项目的时候提示某一个插件不能下载,所以创建不成功,还有就是有些时候下载jar包的时候下载不完整,这些情况都是 中央仓库的地址问题。解决方案:修改maven的settings.xml 配置文件
找到以下配置属性,你自己可以测试下看 配置中的仓库地址是否能点开。另外加上可用的仓库,再测试下 就行了。 再尝试清空本地仓库 org.apache.maven.plugins:maven-resources-plugin 中的所有文件,然maven重新下载
以下仓库是暂时可以用的配置
<mirrors>
<!-- 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> maven-net-cn2</id>
<name> Maven China Mirror</name>
<url> http://repo1.maven.org/maven2/</url>
<mirrorOf>*</mirrorOf>
</mirror>
<mirror>
<id> maven-net-cn</id>
<name> Maven China Mirror</name>
<url> http://mvnrepository.com/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>