Create Linked Repository with Bamboo Java Specs

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible


This article will provide an example Java Specs code that can be used to create Linked Repositories


  • Follow the tutorial Create a simple plan with Bamboo Java Specs to understand how Java specs structure is defined
  • Check the official Bamboo Java specs documentation to get to know how to provide extra options to your Linked repositories
  • Use the following example to create your first Linked Repository via Specs. The provided example will create a Bitbucket type Linked Repository, but you can explore other Repository types such as "pure Git" and SVN

    Currently, Bamboo lacks a feature to export a Linked Repository in Java Specs format. This is being tracked by the following feature request:

    To ease the initial repository code structure in Java Specs format, we advise you to create a temporary Plan repository with the required configuration, export the Plan to Java Specs and use the exported repository definition as a base to create the Linked Repository Specs code. Later on, you can remove the temporary Plan repository.

    package tutorial;
    import com.atlassian.bamboo.specs.api.BambooSpec;
    import com.atlassian.bamboo.specs.util.BambooServer;
    public class MyLinkedRepository {
        public static void main(String[] args) throws Exception {
            // by default credentials are read from the '.credentials' file
            BambooServer bambooServer = new BambooServer("");
            final MyLinkedRepository myLinkedRepository = new MyLinkedRepository();
            final BitbucketServerRepository repository = myLinkedRepository.repository();
        public BitbucketServerRepository repository() {
            final BitbucketServerRepository repository = new BitbucketServerRepository()
                .name("Linked Repository BIG")
                .repositoryViewer(new BitbucketServerRepositoryViewer())
                .server(new ApplicationLink()
                    // Add the Application Link name and its id from Bamboo Server
                // This is the Bitbucket's Project key for the Repository
                // optional SSH keys
                // .sshPublicKey("ssh-rsa xxx...")
                // .sshPrivateKey("BAMSCRT@0@0@5OeUyyy...")
                .changeDetection(new VcsChangeDetection());
            return repository;
    • The creation of Linked repositories will only work by publishing it manually instead of using Repository-Stored Specs. We have an open Feature Request for that BAM-20935 - Getting issue details... STATUS

    • The repository definition has to be defined and published separately instead of defining it inside the plan configuration

DescriptionCreate Linked Repository with Bamboo Java Specs

Last modified on Oct 5, 2022

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.