在conf/setting.xml和m2/repository/setting.xml中加入:
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>proxy.host.net</host>
<port>80</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
-->
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
-->
<proxy>
<host>proxy1.bj.xxxxxx</host>
<port>8080</port>
<nonProxyHosts></nonProxyHosts>
</proxy>
</proxies>