Maven无法下载依赖问题解决办法(公司内网,设置代理)
程序员文章站
2022-05-03 09:47:47
...
找到maven解压目录(D:\Program Files\Java\maven\apache-maven-3.5.4\conf)下的setting.xml,将proxies属性**释的内容复制出来,设置host和port属性即可:
<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>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username></username>
<password></password>
<host>xxx.xx.xx.xx</host>
<port>xxxx</port>
<nonProxyHosts></nonProxyHosts>
</proxy>
</proxies>