问题
Earlier I use sonar-maven-plugin version 3.2
then when a Sonar quality gate fails the build also used to fail. Now I am using sonar-maven-plugin version 3.7.0.1746
, it does not happen so. Even if quality gate fails maven build succeeded. Now when I use version 3.2 in pom.xml it gives the error
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project maven-webapp: Unable to execute SonarQube: Fail to download libraries from server -> [Help 1]
While using sonar-maven-plugin version 3.7.0.1746
doesn't give the above error.
This is how I add the plugin in Pom.xml
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.2</version>
</plugin>
I also got to know that in version 3.2 there was some post-job action like org.sonar.plugins.buildbreaker.QualityGateBreaker
.
How can it be done now? I am using https://sonarcloud.io/ for sonar.
来源:https://stackoverflow.com/questions/60993190/how-to-fail-a-maven-build-when-quality-gate-fails