Does the Sonar for Stash work with multi-module projects?

I can't get the issues to show in the diff view. 


I have a single Git repo which hold several modules. the GAV is something like:

com.mycompany.project
com.mycompany.project.module1

com.mycompany.project.module1.submodule1

 

When running a sonar analysis from the repo root sonarqube assigns the following project keys:

com.mycompany.project:branch-name

com.mycompany.project:module1:branch-name

com.mycompany.project.module1:submodule1:branch-name

The add-on is configured with the project key : com.mycompany:project

However it fails to show information in the diff pane. I tracked the issue down to the call that Sonar for Stash makes to sonarqube:

The call Sonar for Stash makes:
https://mysonar.com/sonar/api/issues/search?resolved=false&severities=INFO,MINOR,MAJOR,CRITICAL,BLOCKER&components=com.mycompany:project:branchname:module1/submodule1/src/main/java/com/mycompany/path/to/file.java 

 

The correct url for the call:
https://mysonar.com/sonar/api/issues/search?resolved=false&severities=INFO,MINOR,MAJOR,CRITICAL,BLOCKER&components=com.mycompany.project.module1:submodule1:branchname:src/main/java/com/mycompany/path/to/file.java 

Have I misconfigured something or does the add-on simply not support multi-module GAV as parsed by sonarqube?

1 answer

Hi,

We've just released version 1.2.0 of Sonar for Stash yesterday which now includes multi-module support. Could you please upgrade and try again? You have to tick the checkbox "Multi-module support" in the repository settings of Sonar for Stash and specify the working sub-directory setting in the same way as you probably have done in Sonar for Bamboo.

Hope that helps.

Kind regards,

Michael from Mibex Software

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,153 views 0 8
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