日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

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

問題描述:

在Eclipse下,使用Maven插件創建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”--偏好設置窗口,在左側列表中找到“Maven”的配置項,在展開列表之后選擇“Archetypes”;

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

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

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



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


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



在點擊完“Finish”按鈕之后,這時候發現Eclipse就開始從遠程的庫中下載構建Web項目所需要的相關東西了:


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




創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

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

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。