如果本机使用了代理服务器连接互联网的话,使用maven编译时,需要配置其proxy元素段,如下:
<$Maven_Home>/conf/settings.xml
///////////begin////////////////
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
| the codes remedified by can_do on 2013-01-30
-->
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>your.proxy.server.name</host>
<port>8080</port>
<nonProxyHosts>127.0.0.1|localhost|cnd</nonProxyHosts>
</proxy>
</proxies>
///////////end//////////////////
<$Maven_Home>/conf/settings.xml
///////////begin////////////////
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
| the codes remedified by can_do on 2013-01-30
-->
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>your.proxy.server.name</host>
<port>8080</port>
<nonProxyHosts>127.0.0.1|localhost|cnd</nonProxyHosts>
</proxy>
</proxies>
///////////end//////////////////
本文介绍如何为Maven配置代理服务器,以便在通过代理连接互联网的环境中正确编译项目。包括设置代理的活动状态、协议类型、用户名、密码、主机名及端口等详细步骤。
3119

被折叠的 条评论
为什么被折叠?



