View Javadoc
1   package com.atlassian.plugin.spring.scanner.test.product.bitbucket;
2   
3   import com.atlassian.bitbucket.repository.RepositoryService;
4   import com.atlassian.plugin.spring.scanner.annotation.component.BitbucketComponent;
5   import com.atlassian.plugin.spring.scanner.annotation.imports.BitbucketImport;
6   import org.springframework.beans.factory.annotation.Autowired;
7   
8   /**
9    * A component that's only instantiated when running in Bitbucket
10   */
11  @SuppressWarnings({"FieldCanBeLocal", "UnusedDeclaration"})
12  @BitbucketComponent
13  public class BitbucketOnlyComponent {
14  
15      private final RepositoryService bitbucketRepositoryService;
16  
17      @Autowired
18      public BitbucketOnlyComponent(@BitbucketImport RepositoryService bitbucketRepositoryService) {
19          this.bitbucketRepositoryService = bitbucketRepositoryService;
20      }
21  }