Mavenでプロキシアクセスを有効にするには、 `{MAVEN__HOME}/conf/settings.xml`にプロキシサーバの詳細を定義します


P.S Maven 3.6

でテスト済み

1.プロキシアクセス

{空} 1。 Maven

settings.xml`を開き、

proxies`タグを探します:

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

1.2以下のようにプロキシサーバーの設定を定義しました。

<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>mkyong</username>
      <password>password</password>
      <host>proxy.mkyong.com</host>
      <port>8888</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>

  </proxies>

1.3完了したら、Apache Mavenはプロキシサーバー経由でインターネットに接続できるはずです。