Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project segregation in Sonar Qube

I have a projects structure like as shown below.

enter image description here

Cloud projects folder are having four type projects (eco-projects, evn-projects, met-projects, svn-projects)

Each type of projects contains again four different projects, like for example in eco-projects we have eco-1-projects, eco-2-projects, eco-3-projects,eco-4-projects.

I have integrated this in Sonar Qube which I got only one Project as Cloud projects like as shown below, when shows all the combined projects source code.

enter image description here

Can we have a hierarchy like visualization in Sonar Qube, like for example lets say when I click the Cloud Projects in Sonar Dashbaord, It will navigate to another four project such as eco-projects, evn-projects, met-projects, svn-projects and now lets say when I click eco-projects it will show me eco-1-projects, eco-2-projects, eco-3-projects,eco-4-projects and now when I click eco-1-projects it will show its source code related dashboard and coverages

My sonar-project.properties is given below

# Required metadata
sonar.projectKey=cloud-projects
sonar.projectName=Cloud Projects
sonar.projectVersion=1.0
# Language
sonar.language=java

# Encoding of the source files
sonar.sourceEncoding=UTF-8

sonar.modules=eco-projects, evn-projects, met-projects, svn-projects

eco-projects.sonar.projectName=eco-projects
eco-projects.sonar.language=java
eco-projects.sonar.modules=eco-1-projects, eco-2-projects, eco-3-projects,eco-4-projects

eco-projects.eco-1-projects.sonar.projectName=eco-1-projects
eco-projects.eco-1-projects.sonar.sources=docroot/WEB-INF/src
eco-projects.eco-1-projects.sonar.language=java

eco-projects.eco-2-projects.sonar.projectName=eco-2-projects
eco-projects.eco-2-projects.sonar.sources=docroot/WEB-INF/src
eco-projects.eco-2-projects.sonar.language=java

eco-projects.eco-3-projects.sonar.projectName=eco-3-projects
eco-projects.eco-3-projects.sonar.sources=docroot/WEB-INF/src
eco-projects.eco-3-projects.sonar.language=java

eco-projects.eco-4-projects.sonar.projectName=eco-4-projects
eco-projects.eco-4-projects.sonar.sources=docroot/WEB-INF/src
eco-projects.eco-4-projects.sonar.language=java
:
:
:

Can anyone please tell me some solution for this

like image 932
Alex Man Avatar asked Feb 11 '17 13:02

Alex Man


1 Answers

AFAIK Sonar doesn't support something like this. It only supports projects, modules and files. This means that you've added (at least?) 1 extra layer Sonar can't work with.

Perhaps you can skip the top 'cloud-projects' level and create a sonar.properties file for each project type? If we take eco-projects as an example, you need to create a sonar.properties file for that and define eco-1-projects, eco-2-projects, etc. as modules. This means that eco-projects is visible in the Sonar dashboard and if you click on it and go to 'code' you'll see all modules. Click on a module to see the files (assuming that is the file level in your case).

BTW you can also use Sonar Dashboards as an extra layer, for example by adding all eco-projects in 1 dashboard.

like image 188
THelper Avatar answered Nov 16 '22 02:11

THelper