Maven問題:Downloading from central: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-a

今天在使用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,即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章