CI pipeline not failing if sonarqube qualitygate fails

CI pipeline not failing if sonarqube qualitygate fails

It passes even if quality gates pass/fails and the next stage deploy gets triggered. I dont want this to happen, the CI pipeline needs to halt when the quality gate fails.
here’s my sonarqube stage, which is running success.
stage: sonarqube_check
script:
- mvn sonar:sonar -Dsonar.qualitygate.wait=true -Dsonar.qualitygate.timeout=300 -Dsonar.gitlab.max_major_issues_gate=0 -Dsonar.sources=src/main/mule,pom.xml -Dsonar.login=$SONAR_TOKEN
allow_failure: false
only:
- master
I have installed the plugin as per below article.

For SonarQube >= 6.7 and < 7.0:

Gitlab version - GitLab Community Edition [12.10.3]
Sonarqube version - 6.7 Community edition