zoukankan      html  css  js  c++  java
  • Maven启用代理访问

    如果你的公司正在建立一个防火墙,并使用HTTP代理服务器来阻止用户直接连接到互联网。如果您使用代理,Maven将无法下载任何依赖。

    为了使它工作,你必须声明在 Maven 的配置文件中设置代理服务器:settings.xml. 

    1. Maven配置文件 

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

    {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>

     

    2. 保存文件

    完成后,Apache Maven 应该是能够通过代理服务器立即连接到Internet

  • 相关阅读:
    你若不努力,整个世界将与你无关
    【规范】yii2 resetful 授权验证
    DFT到FFT的理解
    【统计学】6.统计量及其抽样分布
    【统计学】5.概率与概率分布
    【统计学】4.数据的概括性度量
    【统计学】3.数据的图表展示
    【统计学】2.数据的搜集
    【统计学】1.导论
    小程序API(1.19)利用API函数设置标签栏的方法
  • 原文地址:https://www.cnblogs.com/tanlei-sxs/p/9843428.html
Copyright © 2011-2022 走看看