日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

Eclipse使用Maven插件创建Web项目时出错:Could not resolve archetype org.apache.maven.archetypes

發(fā)布時間:2023/12/4 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Eclipse使用Maven插件创建Web项目时出错:Could not resolve archetype org.apache.maven.archetypes 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

問題描述:

在Eclipse下,使用Maven插件創(chuàng)建Web項目時出錯,錯誤提示如下:


錯誤信息:

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0 from any of the configured repositories.

Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0

Failure to transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): Remote host closed connection during handshake

Failure to transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): Remote host closed connection during handshake


解決方案:

在Eclipse中打開“Preferences”--偏好設(shè)置窗口,在左側(cè)列表中找到“Maven”的配置項,在展開列表之后選擇“Archetypes”;

點擊右側(cè)的“Add Remote Catalog”按鈕,在彈出的窗口中,在“Catalog File”輸入框中輸入:

http://repo1.maven.org/maven2/archetype-catalog.xml

在“Description”輸入框中輸入“maven remote catalog”(名字個人隨意),點擊“OK”按鈕完成新增;繼續(xù)點擊“OK”按鈕保存Maven設(shè)置。



在設(shè)置完畢之后,重新新建Maven項目,在彈出的窗口中,在“Catalog:”下拉框中選擇剛才新建的“maven remote catalog”,然后找到“Group Id”為“org.apache.maven.archetypes”,“Artifact Id”為“maven-archetype-webapp”的選項(在這里列表選項過多,可以在“Filter”輸入框中輸入相應(yīng)的信息進行查找),點擊“Next”按鈕:


輸入項目的相關(guān)信息,點擊“Finish”按鈕,即可完成Web項目的新建工作:



在點擊完“Finish”按鈕之后,這時候發(fā)現(xiàn)Eclipse就開始從遠程的庫中下載構(gòu)建Web項目所需要的相關(guān)東西了:


最后在Eclipse項目列表中發(fā)現(xiàn)有“Framework”項目,并在Tomcat下成功發(fā)布并可以訪問,表明使用Eclipse的Maven插件新建Web項目成功了。




創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎

總結(jié)

以上是生活随笔為你收集整理的Eclipse使用Maven插件创建Web项目时出错:Could not resolve archetype org.apache.maven.archetypes的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。