Problem setting up quality gate when using sonar scan as mvn script and not pipe

Hi

I use bitbucketcloud pipelines to integrate with sonarcloud.
According to the sonar scan documentation and because I use maven in my java project I use as script the mvn command: “mvn -B org.jacoco:jacoco-maven-plugin:prepare-agent verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar”
That is because the sonar scan documentation (https://bitbucket.org/sonarsource/sonarcloud-scan/src/master/README.md) it says " NOTE: For projects using Maven or Gradle please execute a respective scanner directly instead of using this pipe (see examples)."

And then in the quality gate documentation (https://bitbucket.org/sonarsource/sonarcloud-quality-gate/src/master/README.md) it says:
To use this pipe you must have the SonarCloud Scan pipe earlier in the pipeline.

So in sonar scan it ask me to use mvn script if I use maven project but then quality gate ask me to use sonar scan as pipe.

How can I get the scan and quality gate both run on a maven project with bitbucket pipelines?

Hi @valer.roman,

Welcome to our community!

Indeed, it’s not possible right now to check quality gate for a mvn project using BitBucket Pipelines. This is something we want to improve, here is the related ticket : https://jira.sonarsource.com/browse/MMF-1849 , don’t hesitate to vote for it !

Cheers,

Thanks :+1:

1 Like