問題:
從SVN上檢出了一個Maven項目,在執行clean命令時,出現如下錯誤:
java.net.SocketException:Software caused connection abort: recv failed |
分析:
從日志中發現,Maven是在一個國外網站下載東西,我意識到這是遇到了傳說中的Creat Firewall。
解決方案:
通過Maven的設置代理來訪問國外技術網站。Windows系統中,Eclipse中方式如下:

在
當前用戶目錄\.m2,下找到或新建
setting.xml,主要是
proxy標簽。
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository />
<interactiveMode />
<usePluginRegistry />
<offline />
<pluginGroups />
<servers />
<mirrors />
<proxies>
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username></username>
<password></password>
<host>127.0.0.1</host>
<port>8087</port>
<nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
</proxy>
</proxies>
<profiles />
<activeProfiles />
</settings> |