Automate Code coverage report in Enterprise Edition using Spring boot application

Dear team,

I am using SonarQube Enterprise edition Version 7.9.5 (build 38598).

I would like to automate the code coverage report generation process using Spring boot application.

My project key is like 1793:tracker

I have tried https://localhost:9001/api/component_tree?asc=false&ps=100&metricSortFilter=withMeasuresOnly&p=1&s=metricPeriod,name&metricSort=new_uncovered_lines&metricPeriodSort=1&baseComponentKey=1793%3Atracker&metricKeys=new_uncovered_lines,new_line-coverage&strategy=leaves Connection refused: connect

I am confused to use which web api url, what all parameters needs to be passed etc… so that I can get the raw data, Once I get the raw data, I can take this up to next level i.e. generating customized report or html so on.

I would like to know about URL details.


Hi @AbdulRehman ,

I am not sure from your post what is what you are trying to achieve. I am assuming you want to:

  1. Extract some data on some project related to code coverage metrics
  2. Generate a report in some format

You then tell about an error “Connection refused” when trying to reach a URL pointing to localhost:9001.

In order to help you, please ensure that:

  • Read the documentation of the Web API under http(s)://<your_sonarqube_url>/web_api
  • If still in doubt, explain your use case in detail, what are you trying to do

Also note that 8.9 LTS got released, and you should upgrade as soon as possible to be supported.

Best regards,