Maven項目無法解析插件
發現問題
使用IDEA創建Maven項目時,報錯無法解析插件 org.apache.maven.plugins:maven-clean-plugin:2.5
這里使用的是IDEA捆綁的Maven插件
解決方案
查看Maven配置
打開用戶設置文件settings.xml
,在其中加入
<mirrors>
<!-- maven官方鏡像 -->
<mirror>
<id>mirrorId</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name </name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>
<!-- 阿里雲鏡像 -->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://central.maven.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!-- 阿里雲鏡像 -->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!-- junit鏡像地址 -->
<mirror>
<id>junit</id>
<name>junit Address/</name>
<url>http://jcenter.bintray.com/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
如果該路徑下沒有此文件,可以自己創建一個。