To use the property "sonar.branch.name", the branch plugin is required but not installed

I get this error although I have the Developer edition version 6.7. Is this desired behaviour?

Thank you
Liviu

Hi Liviu,

Could you provide a code-formatted (``` on the line before and on the line after) analysis log?

 
Ann

./gradlew :project:sonarqube -Dsonar.branch.name=branch_name -Dsonar.branch.target=master

and I get this:

* What went wrong:
Execution failed for task ':project:sonarqube'.

> Validation of project reactor failed:
    o To use the property "sonar.branch.name", the branch plugin is required but not installed. See the documentation of branch support: https://redirect.sonarsource.com/doc/branches.html.

    o To use the property "sonar.branch.target", the branch plugin is required but not installed. See the documentation of branch support: https://redirect.sonarsource.com/doc/branches.html.

I have sonarqubee 6.7 deveeloper edition installed. and iin that documetantion it tells me to configure the branches in the administration pannel onfiguration > General Settings > General > Detection of long-lived branches but I do not see any Detection of long-lived branches option… :frowning:

Hi,

Is there more to your analysis log?

Also, have you previously analyzed this project? If not, the problem is probably that you’re providing -Dsonar.branch.name=branch_name -Dsonar.branch.target=master on the command line. Even though you’re specifying master, SQ 6.7 isn’t smart enough to recognize that you’re analyzing the main branch if you’re dealing with a project that doesn’t yet exist.

As a side note, 7.9, the latest version and current LTS, was released at the beginning of July. I urge you to upgrade at your earliest convenience.

 
Ann

Hi there Ann,

What do you mean by the project being analyzed before. The project exists for quite some time and it was analyzed from both the command line and from Jenkins. I’ve tried to run the same sonar command but onby with this param -Dsonar.branch.name=branch_name and I get the same error.

Also this is what I see when I click on the branch name in the UI:

It tells me that this is a feature on Developer Editon, but I have Developer Edition already

Regards
Liviu

Hi Liviu,

You’re going to see that in the UI even with Developer Edition if you haven’t yet created any branches.

Regarding edition, what does your SonarQube page footer say? Would you mind sending a screenshot? E.G.

Selection_730

 
Ann

Hey,

This is the footer of my sonar:

Plus On the documentation it says something like this :

This can be updated globally in Configuration > General > Detection of long-lived branches or at project's level in Admininstration > Branches.

But in my case, I just do not see those options. See screenshot for project related configuration:

Also I do not see the Detection of long-lived branches in Configuration > General

Regards
Liviu

Hi Liviu,

Your footer shows that you’re on Community edition, which is why you’re having this problem. For 6.7 you should be able to perform the edition upgrade through the Marketplace (Administration > Marketplace) but since 7.9.1, the latest version and current LTS is available, I urge you to upgrade directly to the 7.9.1 Developer Edition which is a distinct download bundle.

 
HTH,
Ann

Hi there Ann,

Do I have community edition? How come? Let me show some screenshots with my configuration:

This how my Administration> Marketplace looks like:

And the License Manager in the Configuration Tab:

I’m not sure how I have community edition installed. This server runs in a docker image and we’ve used the 6.7 tag, and not “-community” tag.

Regards
Liviu

Hi Liviu,

I guess there was a bug in the footer in 6.7. It looks like you are on the Developer Edition (which you knew the whole time, of course).

So… it looks like you’ve applied the license perhaps without installing the pieces. In 6.7 you install SonarQube (there weren’t all-encompassing edition bundles at that point) and then installed the bundle of plugins for your edition. So I guess that’s the part that’s missing.

At this point, I think it would probably be easiest for you if you just upgraded to 7.9.1, the current LTS (or 8.0, the latest version). At this point we have all-in bundles for each edition, so once you spin it up there’s nothing more to install.

 
Ann

Thank you very much Ann. that was very helpful.

However it seems that the re is a default quality gate that is applied to long lived branches that has only one rule in it:

How can I make sure that the custom quality gate that I’ve created for a project(that includes code coverage rules on new code) applies to the long lived branches as well. As I understand that might not work for short lived branches but the long lived branches will inherit the quality gate of the main/master branch. Am I right? Again I have version 6.7 and unfortunately upgrading is not an option right now

Regards
Liviu

Hi,

In your original post in this thread, you said you’re on 6.7. The expected behavior for this now out-of-date version is to apply a hard-coded, single-criterion Quality Gate to PRs and Short-Lived Branches. So… I think you’ve misunderstood what kind of branch you’re dealing with.

But upgrade to 7.9.1, the current LTS, or 8.0, the current version, and you’ll have all of the “on New Code” criteria from your main quality gate applied to your short-lived branches and PRs.

 
Ann