1.找到文件
当maven无法正常访问网络时候,需要通过代理进行访问
找到Maven的setting.conf文件
2.找到proxies
在maven的 setting.conf文件中找到
默认找到的时候文件 这里是被注释的。
3.配置如下
3.1配置截图
<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></username>
<password></password>
-->
<host>10.26.2.36</host>
<port>8981</port>
<!--
<nonProxyHosts>10.26.2.**</nonProxyHosts>
-->
</proxy>
</proxies>
3.2配置说明
标签
说明
id
可以自定义命名
active
填写true
protocol
填写http
username
有用户名则填写,没有可不填
password
有密码则填写,没有可不填
host
代理主机的地址
port
代理主机的端口
nonProxyHosts
访问这里的是不需要通过代理的