码迷,mamicode.com
首页 > 其他好文 > 详细

启用Maven的代理访问

时间:2018-06-19 14:46:51      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:hosts   sed   .net   pac   maven   war   block   comm   lis   

1. Maven配置文件

找到文件 {M2_HOME}/conf/settings.xml, 并把你的代理服务器信息配置写入。注:{M2_HOME} => D:\software\yiibai.com\apache-maven

{M2_HOME}/conf/settings.xml

<!-- proxies
   | This is a list of proxies which can be used on this machine to connect to the network.
   | Unless otherwise specified (by system property or command-line switch), the first proxy
   | specification in this list marked as active will be used.
   |-->
  <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>
    -->
  </proxies>

取消注释代理选项,填写您的代理服务器的详细信息。

<!-- proxies
   | This is a list of proxies which can be used on this machine to connect to the network.
   | Unless otherwise specified (by system property or command-line switch), the first proxy
   | specification in this list marked as active will be used.
   |-->
  <proxies>
      <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>yiibai</username>
      <password>password</password>
      <host>proxy.yiibai.com</host>
      <port>8888</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
  </proxies>
  1. 保存文件
    完成后,Apache Maven 应该是能够通过代理服务器立即连接到Internet。

注意:重新启动不是必需的。Maven 只是一个命令,当你调用它,它会再次读取该文件。

启用Maven的代理访问

标签:hosts   sed   .net   pac   maven   war   block   comm   lis   

原文地址:https://www.cnblogs.com/userzf/p/9198383.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!