maven3.8安装注意事项
最近自己在做项目时候,进行向往常一样进行maven的安装,在更换为阿里云的镜像,发现总是出现之前低版本不会出现的异常
找了半天,最终锁定问题,记录下,生怕后面的自己又忘了…哈哈哈哈
3.8之前的版本
在进行正常的settings.xml
文件配置时,以往的<3.8
版本的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>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
</mirrors>
3.8的版本
但是!好家伙!!终于说重点了!!!大于3.8
的版本在配置时,你要添加上如下的配置
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>develop</mirrorOf>
<name>make the mirror of nexus</name>
<url>http://192.168.66.66:8089/nexus/content/groups/aliyun_mirror</url>
</mirror>
<!-- maven的新版本要求https 此处也是为啥老报错的重点!!!-->
<mirror>
<id>maven-default-http-blocker</id>
<mirrorOf>!*</mirrorOf>
<url>http://0.0.0.0/</url>
</mirror>
</mirrors>
好嘞!!到此时,一般就是OK了!!!如果还是不行,欢迎留言,一起解决,一起成长!!!