新換了一台電腦,把老電腦上的開發環境部署到新的電腦上,原本好好的Maven工程卻出現了莫名的錯誤
Failure to transfer org.codehaus.plexus:plexus-archiver:jar:2.0.1 from http://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.codehaus.plexus:plexus-archiver:jar:2.0.1 from/to central (http://repo.maven.apache.org/maven2):
No response received after 60000
Failure to transfer org.codehaus.plexus:plexus-io:pom:1.0 from http://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.codehaus.plexus:plexus-io:pom:1.0 from/to central (http://repo.maven.apache.org/maven2): No
response received after 60000
上面的兩個錯誤描述解決步驟是一樣的,就不羅嗦重復介紹了。
以第二種錯誤提示為例:
1.先去掉Maven工程的maven特性,選中工程 鼠標右鍵-->Maven-->Disable Maven Nature. 此步驟后pom.xml錯誤消失
2.為工程增加Maven特性,選中工程 鼠標右鍵-->Configure-->Convert to Maven Project.
經過上述步驟,Maven工程就正常了。
PS:網絡不好的情況下,用Maven真是不爽,最好建立本地私服。