問題背景:
對於一些不能上外網的用戶,在使用maven編譯的時候,會容易報下面的錯:
Network is unreachable (connect failed)
解決方案:
主要是修改maven的conf文件夾中的settings.xml的以下內容
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>10.139.24.104</host>
<port>8381</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
將host和port改爲你所選擇的代理的ip地址和端口號即可