環境変数+Gradle
/etc/environment
を以下のように編集する。
各ユーザ毎に正しい場所に設定したいのであれば、最初に提示したマニュアルを参照のこと。
http_proxy=http://example.jp:8080
https_proxy=http://example.jp:8080
GRADLE_OPTS=" -Dhttp.proxyHost=example.jp -Dhttp.proxyPort=8080 -Dhttps.proxyHost=example.jp -Dhttps.proxyPort=8080"
sodo
コマンド経由で何かを実行している時にプロキシの設定がきいてない場合には、
sudo -E
すると環境変数が引き継がれるのでうまく動くかもしれない。
APT
/etc/apt/apt.conf
を以下のように編集する。
Acquire::http::proxy "http://example.jp:8080";
Acquire::https::proxy "http://example.jp:8080";
git
以下のコマンドを実行する。
git config --global http.proxy http://example.jp:8080
git config --global https.proxy http://example.jp:8080
~/.gitconfig
を以下のように編集してもよい。
[http]
proxy = http://example.jp:8080
[https]
proxy = http://example.jp:8080
Maven
~/.m2/settings.xml
を以下のように編集する。ファイルが当該個所に無ければ作る。
<settings>
<proxies>
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>example.jp</host>
<port>8080</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
<proxy>
<id>optional2</id>
<active>true</active>
<protocol>https</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>example.jp</host>
<port>8080</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
</proxies>
</settings>