對於不能上外網的用戶,maven編譯如何配置代理

問題背景:

對於一些不能上外網的用戶,在使用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地址和端口號即可

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章