maven设置代理

maven默认直接访问repo仓库,但国外的仓库太慢了。

这里可以在maven/conf/setting.xml中设置代理,设置一个连接国外网速比较快的代理:

<proxies>

<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>127.0.0.1</host>
<port>8087</port>
<nonProxyHosts>local.net|some.host.com|192.168.17.12|10.234.10.12</nonProxyHosts>
</proxy>

</proxies>

我这里是使用的goagent,所以就设置为本机的goagent为代理,速度果然提高了好多。

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>