Is that possible to create a quality gate and pass this parameter with sonarscanner command line

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve : pass a quality gate parameter with sonar-scanner command line
  • what have you tried so far to achieve this: added .Dsonar.qualitygate=“name of the quality gate that I have created”

But this doesn’t work, it still goes through with the default quality gate

Generally speaking, the quality gate for a project isn’t something we expect to change from one scan to another. A team would generally benefit from the standard of what passes/fails being consistent across time. Can you share why you’re interested in such an approach?

If you truly need to set the quality gate for a project prior to a scan, you could do so via our web API, the documentation for which is included in your SonarQube instance in the footer of most pages.