Source Repository Module


Bamboo 1.1 and later

On this page:


A plugin module which defines a repository in Bamboo, such as CVS, Subversion, or Perforce.


Plugins of this type must implement the com.atlassian.bamboo.repository.Repository interface. For (comparative) simplicity, you should use the class AbstractRepository as a starting point and extend from that.

Sample Module Descriptor Element

  <repository key="svn" name="SVN Repository"
    <description>A Subversion Repository</description>
    <resource type="freemarker" name="edit" location="templates/plugins/repository/svnRepositoryEdit.ftl"/>
    <resource type="freemarker" name="view" location="templates/plugins/repository/svnRepositoryView.ftl"/>




The RepositoryEventAware interface allows you to instruct the repository to perform a custom action before and/or after the checkout/update occurs.


The PostConfigurableRepository allows any custom configuration to be performed after the repository has been created or another has been selected. It is typically used to add and remove configuration after changes have been made to the repository configuration by a user.


The CustomVariableProviderRepository allows to define custom variables that can be used to configure the plan.

Supporting "Import from Maven"

By implementing MavenPomAccessorCapableRepository on your repository module this interface allows your Source Repository Module to be used from the 'Import a Maven 2 project' feature.

The MavenPomAccessorCapableRepository.getMavenPomAccessor() should return your own implementation of the MavenPomAccessorAbstract class that provides the ability to checkout and find the Maven pom from the repository provided by the user.


Add a line similar to the one below to your repository descriptor in the atlassian-plugin.xml. This is similar to the "edit" resource

<resource type="freemarker" name="mavenPomCheckoutAccessEdit" location="templates/plugins/repository/p4RepositoryMavenPomCheckoutAccessEdit.ftl"/>

Here is the example Freemarker template:

[#if repository.perforceExecutableSet]
    <div class="infoBox">
        [@ww.text name='repository.p4.executableExists']
     <div class="warningBox">
        [@ww.text name='repository.p4.noExecutable']

[@ww.textfield labelKey='repository.p4.port' name='repository.p4.port' required='true' helpKey='perforce.fields' /]
[@ww.textfield labelKey='repository.p4.client' name='repository.p4.client' required='true' helpKey='perforce.fields' /]
[@ww.textfield labelKey='repository.p4.depot' name='repository.p4.depot' required='true' helpKey='perforce.fields' /]
[@ww.textfield labelKey='repository.p4.mavenPomCheckout.pomRelativePath' name='repository.p4.mavenPomCheckout.pomRelativePath' /]
[@ww.textfield labelKey='repository.p4.username' name='repository.p4.user' helpKey='perforce.fields' /]
[@ww.hidden name="temporary.p4.passwordChange" value="true" /]
[@ww.password labelKey='repository.p4.password' name='temporary.p4.password' helpKey='perforce.fields' required='false'/]
Was this page helpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport