maven中设置代理服务器
生活随笔
收集整理的這篇文章主要介紹了
maven中设置代理服务器
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
打開%m2_home%/bin/settings.xml,增加如下一段:
<proxies>?? ?<!-- 使用代理上網 -->
?? ?<proxy>
?? ??? ?<id>optional</id>
?? ??? ?<active>true</active>
?? ??? ?<protocol>http</protocol>
?? ??? ?<username></username>
?? ??? ?<password></password>
?? ??? ?<host>192.168.1.1</host>
?? ??? ?<port>8081</port>
?? ??? ?<nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
?? ?</proxy>
</proxies> host、port、username、password不用說,nonProxyHosts就是例外地址。 ?
如果bin下面沒有settings.xml,手工新建一個,完整的setting.xml如下:
<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"?? ?xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
?? ??? ??? ??? ??? ??? ??? ??? ?http://maven.apache.org/xsd/settings-1.0.0.xsd">
?? ?<localRepository />
?? ?<interactiveMode />
?? ?<usePluginRegistry />
?? ?<offline />
?? ?<pluginGroups />
?? ?<servers />
?? ?<proxies>
?? ??? ?<!-- 使用代理上網 -->
?? ??? ?<proxy>
?? ??? ??? ?<id>optional</id>
?? ??? ??? ?<active>true</active>
?? ??? ??? ?<protocol>http</protocol>
?? ??? ??? ?<username></username>
?? ??? ??? ?<password></password>
?? ??? ??? ?<host>192.168.1.1</host>
?? ??? ??? ?<port>8081</port>
?? ??? ??? ?<nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
?? ??? ?</proxy>
?? ?</proxies>
?? ?<profiles />
?? ?<activeProfiles />
</settings>
?
完成后保存,再往c:\document and setting\\.m2\下面復制一份即可。
新人創作打卡挑戰賽發博客就能抽獎!定制產品紅包拿不停!
總結
以上是生活随笔為你收集整理的maven中设置代理服务器的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Hadoop框架:HDFS高可用环境配置
- 下一篇: oracle表分析 示例