How to Override the Maven Local Repository setting

お困りですか?

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

コミュニティに質問

目的

When running a Maven Task in Bamboo, the build agent will often default to using ~/.m2/repository as the local repository. This guide will offer two options to override this setting, one locally – for one task – and one globally for Maven.

ソリューション

To achieve this for a given Task, you can:

  1. Go to the Plan that runs the maven clean deploy command
  2. Under the "Actions" menu, select "Configure Plan"
  3. Click on the Job that runs the Maven command
  4. Click on the Maven Task
  5. Add -Dmaven.repo.local=~/.m2/repository to the "Goal" section, before "clean deploy"
  6. [保存] をクリックします。

To achieve this in the settings file, you can:

  1. Open M2_HOME/conf/settings.xml in a text editor
  2. Find the <localRepository>/path/to/local/repo</localRepository> line
    • note: it may be inside a comment block <!-- ... ->, if so, move the -> to before the <localRepository> tag
  3. Replace /path/to/local/repo with the path to your repository
  4. Save and close

参考情報

To configure Bamboo to use different Maven repositories for different builds, please see Configuring repository isolation for Maven executables.

 

最終更新日 2016 年 8 月 17 日

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

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