How relaunch an analysis?

I created a new project, launched the first analyze, get some results, made the update of my code, but I didn’t find any way to relaunch the analyses to confirm my correction. The only way I found it’s to delete the project and recreate it, I’m pretty sure that it’s not the good way !
So someone can explain me how it’s possible to relaunch an analysis easily ?

Hi,

You need to build your project in a specific way, and run the scanner afterwards.

The build-wrapper is required to build your project. It will compile your project the normal way, but in the meantime creating a special output (.json) that will be used afterwards by the scanner.

The build-wrapper can be downloaded from your server.
Example for the C-family projects: https://docs.sonarqube.org/latest/analysis/languages/cfamily/
Scanner howto: https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/

useful post: https://stackoverflow.com/questions/40746933/running-sonarqube-analysis-scan-sonarsource-build-wrapper

I highly recommend to use come CI tool, like Jenkins, which will take care of these steps automatically.

Regards,
Tamas

1 Like

Thx for your reply, my problem is after all of this. I built my project with the wrapper, launched the scanner, get some results into sonarQube and so, modified my code in accordance with the result of the analyse.
But after that, I’m blocked. I want to relaunch the scanner but the only way I found it’s to delete the project and recreate it…

How do you mean blocked? What happens when you try to run analysis again the same way, using the same project key?

That’s my problem, I don’t find any way to run analysis again ! The only way I found, it’s to delete the project and redo the analysis.

What happens if you redo the analysis without deleting the project?

How you can do that ? I didn’t find any button or menu to redo the analysis… :slight_smile:

You will need to rebuild your project using the build wrapper and re-run sonar-scanner with the same inputs. There’s nothing to do from the SonarQube UI.

Yes ! You resolved my problem !
Thank you very much !

1 Like

:wave: Heya folks,

Sorry if I’m necrobumping, but I came across this post as a snoarqube noob and I think it’d be worth having the correct sonar-scanner command always visible from the dashboard. I run sonarqube in lxc because some of the repos I work with have hella old dependencies. If I analyze the project, then someone makes a patch and I come back to the container a week later, I think it’s pretty crude to have to dig through my BASH history to find the command again.

You might reply, “Willard! Just have it in your README or something!”

to which I’d reply back, “Sure, but what if I forget to do that? The command is lost then.”

It’d be pure convenience, but I think it’d be helpful to have it easily accessible from SonarQube at all times.