今天在使用IDEA創建Maven的webapp時遇見這樣一個不叫問題的問題:
Downloading from central: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/maven-metadata.xml
很奇怪,我的maven倉庫配置了私有庫,,並且在maven setting.xml中配置了mirror(阿里雲的鏡像),但是,經常會遇到執行mvn命令的時候,會提醒,下載不下來。
解決方式:在項目的pom.xml中添加如下一段代碼:
<repositories>
<repository>
<id>central</id>
<url>http://host:port/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://host:port/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
直接放在project下:如圖:
重新build,即可。