新しい JDK 機能を定義する
Bamboo でジョブを構築する際に JDK を利用するには、あらかじめ JDK をインストールし、Bamboo で機能として定義する必要があります。
At least one JDK was automatically defined when you installed Bamboo. You can define additional JDK capabilities that are:
Once you have defined a new JDK capability in your Bamboo system, its label (e.g. 17) will appear in the Build JDK list when you configure a job's builder (see Configuring tasks). The JDK you select will be used for every one of that job's builds. That is, the job can only be built by agents which have a JDK capability whose label is specified in the job's Build JDK field. エージェントが独自の JDK 機能を持っている場合、その値は同じ名前の共有 JDK 機能 (存在する場合) の値よりも優先されることにご注意ください。
エージェントの JDK 機能を定義する
新しいエージェント固有の JDK 機能を定義するには、次の手順に従います。
- From the top navigation bar select Adminitration > Build resources > Agents.
- Select the name of the required agent.
- Go to the Capabilities tab, and then Add capability.
- Select Capability type > JDK.
- [JDK ラベル] フィールドに、JDK の名前またはラベルを入力します。Bamboo でジョブのビルダーを設定するたびに、これが [ビルド JDK] リストに表示されます。
- [Java ホーム] フィールドに、JDK ホーム ディレクトリの場所を入力します。
- 追加 を選択します。
共有リモート JDK 機能を定義する
共有リモート JDK 機能はエラスティック エージェントと共有されません。
新しい共有リモート JDK 機能を定義するには、次の手順に従います。
- From the top navigation bar select > Build resources > Agents > Shared remote capabilities.
- Select Capability type > JDK.
- [JDK ラベル] フィールドに、JDK の名前またはラベルを入力します。Bamboo でジョブのビルダーを設定するたびに、これが [ビルド JDK] リストに表示されます。
- [Java ホーム] フィールドに、JDK ホーム ディレクトリの場所を入力します。
- 追加 を選択します。
注意
- Configuring generic JDK capabilities — If you want to indicate that an agent is capable of running builds for a set of related JDKs (e.g. all point versions of JDK 17), you set up generic JDK capabilities to encompass these JDKs.
For example, you can set up the following JDK capabilities for your Bamboo agent(s):- JDK (where 'JDK Label' = '
JDK
' and 'Java Home' ='/usr/java/jdk17.0_07'
) — this JDK capability indicates that an agent(s) is capable of running builds with any JDK requirement. - JDK 17 (where 'JDK Label' = '
JDK 17
' and 'Java Home' = '/usr/java/jdk17.0_07
') — this JDK capability indicates that an agent(s) is capable of running builds with a JDK 17 requirement or any point version of JDK 17, e.g. 17.0_07, 17.0_08, etc. - JDK 17.0_07 (where 'JDK Label' = '
JDK 17.0_07
' and 'Java Home' = '/usr/java/jdk17.0_07
') — this JDK capability indicates that an agent(s) is only capable of running builds with a JDK 17.0_07 requirement.
- JDK (where 'JDK Label' = '
- 余分な JDK 機能を見つけたい場合は、Bamboo で設定されている JDK 機能のリストを表示して、不要な JDK 機能を削除できます。
- 自動定義機能 - これは、Bamboo がインストールされたマシンに存在していたシステム環境変数 (
JAVA_HOME=/opt/java/java_sdk17
など) によって異なります。
- Bamboo Server では、インストール時に存在していた環境変数は、Bamboo に共有のローカル機能として保存されていたものです。
- リモート エージェントでは、インストール時に存在していた環境変数は、Bamboo にエージェント固有の機能として保存されていたものです。
Last modified on Mar 31, 2025
Powered by Confluence and Scroll Viewport.