0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【メモ用】Mavenのプロキシ設定

Posted at

背景

現在のチームはプロキシ(サーバ)を活用しているため、Mavenのプロキシ設定しないと、ビルド出来ない状態になるかもしれません。
下記のようなエラーが出てくる。
build error.PNG

プロキシ設定

先ずはMavenのインストールディレクトリに入ります。分からなかったら、下記のCMDで探してましょう。

mvn -v

image.png

confフォルダに入り、settings.xmlファイルを開く。
proxiesタグを探して、自分のプロキシ情報を合わせて設定します。

setting.xml
  <proxies>
    <proxy>
      <id>optional1</id>
      <active>true</active>
      <protocol>http</protocol>
      <!-- 認証がなければ、外していい -->
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>あなたのプロキシホスト</host>
      <port>あなたのポート</port>
      <!-- 設定しなくてもいいです -->
      <nonProxyHosts>127.0.0.1(設定しなくてもいいです)</nonProxyHosts>
    </proxy>
    <proxy>
      <id>optional2</id>
      <active>true</active>
      <protocol>https</protocol>
      <!-- 認証がなければ、外していい -->
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>あなたのプロキシホスト</host>
      <port>あなたのポート</port>
      <!-- 設定しなくてもいいです -->
      <nonProxyHosts>127.0.0.1</nonProxyHosts>
    </proxy>
  </proxies>

ここまで、OKだと思います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?