MotoWrx
MotoWrx

Reputation: 23

Custom sonar plugin and widget, display the same sonar measure from multiple projects

I have sonar 5.1 set up with multiple projects lets say project A and project B, and have ran analysis on both. I am able to import my coverage and test result files into both and every thing looks fantastic. What I would like to do is to pull the same lines_covered measure from project A and project B and display them within the same widget. I created a custom plugin and widget and I get the project drop down when editing the widget.

If I use the 'Global' attribute the project drop down goes away. Any ideas

Upvotes: 0

Views: 999

Answers (1)

Johannes Zink
Johannes Zink

Reputation: 495

Do you really want to create a custom plugin for this? You can display metrics over multiple projects with SonarQube widgets.

  1. Create a new Measure Filter
  2. Select components "Projects"
  3. Click on "Change columns"
  4. Select the metrics you want to see (in your case lines_covered) and click on "Close"
  5. Save the Filter
  6. Add the "Measure Filter as List" widget to your dashboard
  7. Select the filter and see all your projects listed with the selected metrics

Upvotes: 3

Related Questions