情形如圖:
pom文件上這行也有報紅,截圖和提示分別如下:
Could not transfer artifact org.junit.jupiter:junit-jupiter-api:jar:5.3.2 from/to central (https://repo.maven.apache.org/maven2): connect timed out
org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.junit.jupiter:junit-jupiter-api:jar:5.3.2 from/to central (https://repo.maven.apache.org/maven2): connect timed out
at io.takari.aether.connector.AetherRepositoryConnector$2.wrap(AetherRepositoryConnector.java:856)
at io.takari.aether.connector.AetherRepositoryConnector$2.wrap(AetherRepositoryConnector.java:1)
at io.takari.aether.connector.AetherRepositoryConnector$GetTask.flush(AetherRepositoryConnector.java:630)
......
這裏只貼一部分。
折騰了很久,嘗試了給pom中手動加依賴,又折騰了很久,沒有解決....
解決辦法
在項目上右鍵---maven---add dependency
搜索jupiter,點選如圖紅圈所圈的三個jar包,點擊OK,分別下載好後
項目上右鍵maven---update project---勾選 Force Update這一項,點擊OK,這次更新完項目就OK了。
注意:不同的報錯解決方法都相同,但是要注意你的報錯是不是缺少jupiter所致,比如你的報錯在其他地方,那麼搜這個文件缺少的包即可。