Configuring repository isolation for Maven executables

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

Bamboo allows you to isolate Maven (2.x or later only) executables on an agent-specific basis. If you configure repository isolation for a particular Maven executable capability, each agent that uses this executable will have its own private Maven 2.x artifacts directory, thereby allowing you to avoid these jar and dependency file corruptions. Each isolated repository directory has the path:

$BAMBOO_HOME/.m2/AGENT-${bamboo.agentId}/repository

You may want to configure repository isolation for Maven executables, if you run multiple Maven executables on one server machine which run under the same user account on that server, but belong to different Bamboo agents. In this case, the agents will use the same default Maven artifacts directory: $HOME/.m2/repository (or %USERPROFILE%\.m2\repository for Windows-based servers). This is the directory to which Maven dependency jars are downloaded and where project artifacts are installed during the "install" phase of a Maven build.

Hence, problems can arise if Bamboo uses these multiple Maven executables simultaneously. For example, if multiple agents on a single computer, each with a different Maven executable capability, start to run Maven builds simultaneously from the queue, the different Maven executables may attempt to download the same dependency to the same artifacts directory location, resulting in corruption of the downloaded jar and dependency files.

始める前に

  • This feature is not available for Maven 1.x executables.
  • When configuring any Maven executables in Bamboo in which you want to force local repository isolation, ensure that the executable label you use is one that identifies it as such — for example, Maven 2.x with local repository isolation.

To configure a new local server Maven capability with repository isolation:

  1. From the top navigation bar select cogwheel icon > Build resources > Server capabilities.
  2. In the Add capability section, select your executable and enter its details as described:

    Capability type
    Select Executable.

    Type
    Select one of the Maven options (2.x or later).

    Executable label
    Enter Maven with local repository isolation.
     (info) You can use any label you wish. However, it will help you and your Bamboo users if you enter an appropriate executable label that identifies this Maven 2.x executable as one that uses local repository isolation.

    Path
    Enter the path for your Maven executable.

  3. 追加 を選択します。
  4. Select the label for the executable you have just added. The executable capability summary screen will be displayed (see 'Maven 2.x Executable' screenshot below).
  5. Select Edit capability configuration. The Configure capability screen will be displayed (see 'Maven 2.x Repository Isolation' screenshot below).
  6. Select the Local repository isolation checkbox.
  7. 保存 を選択します。


Maven capability configuration

Local repository isolation option in Maven capability configuration

最終更新日 2021 年 8 月 3 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.