I'm trying to user Sonarqube with Jenkins.
I've added the Quality Gates Plugin, to fail the build in Jenkins if the Quality Gates are not respected in Sonarqube.
However, as you can see below, there is no Project Key field for Quality Gates.
Also, if I try to save the configuration, I get:
JSONObject["projectKey"] not found.
Any idea why this would not appear?
Go to Manage Jenkins > Configure System and scroll down to the SonarQube servers section. This is where we'll add details of our SonarQube server so Jenkins can pass its details to our project's build when we run it. Click the Add SonarQube button.
To pass the Quality Gates, the project should pass through each of the thresholds set. When SonarQube runs it will identify if the code meets all the quality thresholds you have set – else it will fail the Quality Gate and will not allow you to check in code to source control.
Defining Quality Gates Each Quality Gate condition is a combination of: a measure. a comparison operator. an error value.
I have the same issue. I also didn't initially add the sonar server in the system config, after doing that, I see the Project Key field only in the Post Build Actions.
That doesn't help if you want to add it as a build step or post build step. EG. maven install with sonar scan, then test the gate, then if gate passes, maven deploy.
In http://jenkinsInstance/configure
I had setup SonarQube only in "SonarQube servers" but not in "Quality Gates" as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With