如果在pom.xml總是顯示找不到對應的包,那麼應該考慮一下是否是settings.xml中設置的鏡像源地址不正確。
按照此前我在網上尋找的阿里鏡像大多是下面這種:
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central</url>
</mirror>
但是根據該博客所述,阿里的鏡像服務進行了改版,鏡像源地址發生了變更,如下所示:
<mirror>
<id>nexus-aliyun</id>
<name>Nexus aliyun</name>
<url>https://maven.aliyun.com/repository/central</url>
<mirrorOf>central</mirrorOf>
</mirror>
當我更改成功後,就沒有再出現Package not found的問題了!
希望能夠對讀者有幫助!