# Talend CommandLineのプロキシ設定

Talendを使用すると、Maven設定ファイルを編集して新しいビルドパラメーターを追加することで、Talend CommandLineのプロキシサーバーを設定できるようになります。

プロキシサーバーの設定方法:

* Maven設定の&lt;settings&gt;セクションに、次の項目を追加します:
  ```
    <proxies>
      <proxy>
        <id>httpProxy</id>
        <active>true</active>
        <protocol>http</protocol>
        <host><proxy_host></host>
        <port><proxy_port></port>
        <username><username></username>
        <password><password></password>
        <nonProxyHosts>localhost</nonProxyHosts>
      </proxy>
      <proxy>
        <id>httpsProxy</id>
        <active>true</active>
        <protocol>https</protocol>
        <host><proxy_host></host>
        <port><proxy_port></port>
        <username><username></username>
        <password><password></password>
        <nonProxyHosts>localhost</nonProxyHosts>
      </proxy>
    </proxies>
  ```
* プロジェクトのビルドに使われているMavenコマンドに、次のパラメーターを追加します:
  ```
  -Dhttp.proxyHost=<proxy_host> 
  -Dhttp.proxyPort=<proxy_port> 
  -Dhttp.proxyUser=<username> 
  -Dhttp.proxyPassword=<password> 
  -Dhttp.nonProxyHosts=localhost 
  -Dhttps.proxyHost=<proxy_host> 
  -Dhttps.proxyPort=<proxy_port> 
  -Dhttps.proxyUser=<username> 
  -Dhttps.proxyPassword=<password> 
  -Dhttps.nonProxyHosts=localhost
  -Djdk.http.auth.tunneling.disabledSchemes= 
  ```

  例:
  ```
  mvn org.talend.ci:builder-maven-plugin:<version>:generateAllPoms 
  -s <studio_path>\configuration\maven_user_settings.xml 
  <!-- This parameter is only supported for users with Talend Studio 8.0.1 R2024-04 or lower 
  -Dtalend.studio.p2.base=https://<p2_site>/base --> 
  -Dtalend.studio.p2.update=https://<p2_site>/update/ 
  -Dlicense.path=<license_path> 
  -Dhttp.proxyHost=<proxy_host> 
  -Dhttp.proxyPort=<proxy_port> 
  -Dhttp.proxyUser=<username> 
  -Dhttp.proxyPassword=<password> 
  -Dhttp.nonProxyHosts=localhost 
  -Dhttps.proxyHost=<proxy_host> 
  -Dhttps.proxyPort=<proxy_port> 
  -Dhttps.proxyUser=<username> 
  -Dhttps.proxyPassword=<password> 
  -Dhttps.nonProxyHosts=localhost
  -Djdk.http.auth.tunneling.disabledSchemes= 
  ```

-Djdk.http.auth.tunneling.disabledSchemesパラメーターについて:

プロキシサーバーへのアクセスでサポートされているのは基本認証のみです。JVMはデフォルトで基本認証を無効にしているので、CIコマンドにこのパラメータを追加する必要があります。パラメーター値は空のままでも構いません。

ヘッドレスのLinuxユーザーへの注:

GUIがインストールされていない状態でCIコマンドを実行すると、次のようなエラーが発生することがあります:

```
[INFO] !ENTRY org.eclipse.equinox.security 4 0 YYYY-MM-DD HH:MM:SS
[INFO] !MESSAGE No password was found. Value of "pass" is being stored as a non-encrypted value in the node  "/org.eclipse.core.net.proxy.auth/HTTP".
```

このエラーはブロッカーではありませんが、サーバーのパスワードが安全でない方法で保存されていることを示す警告です。この問題を修正するためには、Mavenコマンドに-Declipse.passwordパラメーターを追加します。

例:

```
mvn org.talend.ci:builder-maven-plugin:<version>:generateAllPoms 
-s <studio_path>\configuration\maven_user_settings.xml 
<!-- This parameter is only supported for users with Talend Studio 8.0.1 R2024-04 or lower 
-Dtalend.studio.p2.base=https://<p2_site>/base -->
-Dtalend.studio.p2.update=https://<p2_site>/update/ 
-Dlicense.path=<license_path> 
-Dhttp.proxyHost=<proxy_host> 
-Dhttp.proxyPort=<proxy_port> 
-Dhttp.proxyUser=<username> 
-Dhttp.proxyPassword=<password> 
-Dhttp.nonProxyHosts=localhost 
-Dhttps.proxyHost=<proxy_host> 
-Dhttps.proxyPort=<proxy_port> 
-Dhttps.proxyUser=<username> 
-Dhttps.proxyPassword=<password> 
-Dhttps.nonProxyHosts=localhost 
-Djdk.http.auth.tunneling.disabledSchemes= 
-Declipse.password=<path_to_master_password_file>
```

プロキシの設定の詳細は、該当する[Maven Apacheのドキュメンテーション](https://maven.apache.org/guides/mini/guide-proxies.html)をご覧ください。