Sonar 4 Bitbucker Server Copy Quality Profile

We use a custom quality profile in Sonar, but despite enabling Quality Gate in Provisioning, the analysis is still using the Default Profile.

We have verified:

  • The Sonar master project is using the custom profile.
  • The Sonar Gradle task is working fine in Bamboo.
  • The Provisioning - Quality Profiles checkbox is enabled.
  • The corresponding Bamboo build has the following in the log:
build	19-Oct-2016 23:06:39	323 files ignored because of inclusion/exclusion patterns
build	19-Oct-2016 23:06:39	Quality profile for java: Sonar way
build	19-Oct-2016 23:06:40	Sensor Lines Sensor

Since the log suggests that the analysis is done using the default profile, I wonder how profile copying is implemented. The Bamboo task triggers the analysis. Bitbucket just loads the post-analysis results from Sonar. If the profile copying is managed by sonar4stash, how does sonar4stash "tell" the bamboo task what the source profile to copy during the analysis?


We are on:

  • Sonar 6.0
  • Bitbucket Server 4.9.1
    • Sonar for Bitbucket Server 1.10.3
  • Bamboo 5.12.2
    • Sonar for Bamboo 1.4.2


1 answer

1 accepted

0 votes
Accepted answer


Quality profile provisioning works as follows: Sonar4Stash will use the quality profile of the configured master branch in the plug-in's repository settings. Whenever it detects that a new branch was created, it will create a new SonarQube project for it and configure its quality profile to be the same as the one from the master branch.

If this process didn't work in your case, do you see any errors in the Stash application log when the branch was created?

Best regards,



You are right. When new branches are created, the addon created Sonar projects and copied the master project's quality profile. There were some old branches that existed before installing the addon. Those branches' Sonar projects don't have the master project's quality profile.

The addon's behavior matches your explanation. However, we observed that quality gates are not copied. No errors in Bitbucket's logs. Is this a bug?

Provisioning of quality gates is not yet supported, but it is on our roadmap smile

@Michael Rüegg [Mibex Software], that's great to hear! We are very happy with Sonar for Bitbucket Server so far. Keep up the good work.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 29, 2018 in Marketplace Apps

How to set up an incident workflow from the VP of Engineering at Sentry

Hey Atlassian community, I help lead engineering at Sentry, an open-source error-tracking and monitoring tool that integrates with Jira. We started using Jira Software Cloud internally last year, a...

1,726 views 3 11
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you