Sonar plugin to access and publish key project metrics
Hi all,
I’m trying to write a sonar plugin that collects key metrics (coverage, rules compliance, test success etc.) at the end of a maven (multimodule) build, and publishes them to a remote datastore via http. I’m interested in the aggregated top-level results, basically what you can see on the dashboard of a multimodule project. Not so much interested in the metrics of all individual modules.
However I’m struggling to get access to this data:
- as far as I read in a previous post about the same topic, PostJob seems not to offer access to the metrics. If I misunderstood this, I’d very much appreciate an example or any pointers on how to access the metrics (using the Project or SensorContext)
- Is PostJob the wrong extension for this task?
- I was thinking about accessing the data via REST API in my PostJob as a workaround. Any better ideas?
Any help is much appreciated, if anyone can point me to other plugins that do something similar, that would help a lot.
Regards,
Thomas