[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-archetype-plugin/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): Connection to http://repo.maven.apache.org refused
大家注意一下:當出現這個警告時,你應該猜到這是一個連接不上的問題
可把我害慘啦,我一直以爲是jdk和maven版本不匹配問題。
因爲Apache 的服務器不在國內,可能會因爲謀而原因導致連接不上http://repo.maven.apache.org refused
所以現在就是要解決連接問題:
國內的阿里技術很厲害 爲我們提供了國內的鏡像
你只需要在你的 conf 文件夾下的setting文件中將對應的代碼換做下面的代碼。
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
完美解決: