Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to integrate Jira plugins with Bitbucket, SonarCube, Jacoco and Bitbucket Pipelines

The aim of the article is to make a short guide on how to setup a simple Jira plugin development process using SonarCube, Jacoco , Bitbucket and Bitbucket pipelines. All of the mentioned tools are free of charge. Bitbucket pipeline offers you 50 free minutes per month to run your pipeline.
A few words on each tool.
SonarCube is a tool for code quality inspection. It can detect bugs, code smells and security vulnerabilities in your code.
Jacoco is a code coverage tool, which lets you measure how much of your code covered by unit tests.
Bitbucket is a web-based hosting service, which is  used for managing source code.
Bitbcket pipeline is a continuous integration tool.
The tools above will help you to develop a higher quality software.
Ok. Let's move to the guide section.
1. Create Bitbucket account on
2. Setup SonarCube.
2.1. Create a SonarCube account on Use your bitbucket account to authenticate in SonarCube.
2.2. Create a new organization called tutorial in
2.3. Generate a new security token in
3. Install Atlassian SDK and create your first servlet Jira plugin.
I will make a short list of what should be done. You can find a more detailed explanation here:
3.1. Download Atlassian SDK.
3.2. Create a folder for storing your Jira plugins and execute the following command within the folder:
Enter com.atlassian.tutorial for the groupId and ciprocess for the artifactId. Then press several times “Enter” and type Y when you are asked if you want to create the plugin.
3.3. Go down to the ciprocess folder (cd ciprocess) and execute the following command:
When you are asked to choose a number you should choose 21. Number 21 means that the Servlet module will be created for you plugin. When you are asked questions about the servlet class name and package press enter. When you are asked “Show advanced setup” press N. When you are asked “Add Another Plugin Module” press N.
3.4 Run the plugin with the following command
After Jira started you can go to the following url in your browser:
And you will see the “Hello World” message.
4. Connect Jacoco.
4.1. Add the following lines into the <build><plugins> section of the pom.xml file:
4.2. Add the following lines into <properties> section of the pom.xml file:
Change sonar.login variable with the security token which you received in 2.3.
4.3. Create .gitignore file in the plugin directory with the following content
# Compiled class file

# Log file

# BlueJ files

# Mobile Tools for Java (J2ME)

# Package Files #

# virtual machine crash logs, see

# User-specific stuff:

# Sensitive or high-churn files:

# Gradle:

# CMake

# Mongo Explorer plugin:

## File-based project format:

## Plugin-specific files:

# IntelliJ

# mpeltonen/sbt-idea plugin

# JIRA plugin

# Cursive Clojure plugin

# Crashlytics plugin (for Android Studio and IntelliJ)

5. Put the source code to a bitbucket repository.
5.1. Sign in to your Bitbucket account
5.2. Create a new repository with GIT version control and name it “ciprocess”.
5.3. Install on your computer GIT client.
5.4. Open terminal, go to your plugin folder and initialize a git repo with the following command:
git init
5.5. Add all files to the local repo by executing
git add *
git commit -m “initial commit”
5.4. Push your source code to the repo in Bitbucket. On the overview page of your created repository in you will see instructions on how to put your source code into your repository. In my case instructions look like this
Step 1: Switch to your repository's directory
cd /path/to/your/repo
Step 2: Connect your existing repository to Bitbucket
git remote add origin
git push -u origin master
Follow the instructions, which you can see in the overview page of your bitbucket repository.
6. Create bitbucket pipeline.
6.1. Go to your repository in and choose Pipelines menu.
6.2. Create pipeline for Java language. bitbucket-pipelines.yml should look like this:

image: translucent/atlassian-plugin-sdk:latest
    - step:
        script: # Modify the commands below to build your repository.
          - atlas-mvn -X clean package sonar:sonar # -B batch mode makes Maven less verbose

You can read more about creating bitbucket pipeline here:
7. Upon new pushes to the repository the pipeline will build your module and create the build report in SonarCube.
You can see the build report here:

If you need the source code of the plugin you can get it here:

1 comment

very helpful what i was looking for is to give code coverage information in the bitbucket pull-request based on a report generated in bitbucket pipelines... same as you have build status


Log in or Sign up to comment
Community showcase
Published in Agile

Join us LIVE: Atlassian & Experts Talk Research & Insights @ Scale

Hello all! What have you learned from your customers lately? Our live-streamed series continues by exploring CX, UX, and the power of research & insights at scale with Leisa Reichelt, Head of R...

479 views 3 10
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you