I'm trying to get my build to break based on sonar results - so I've got a build-breaker running off the results in report-task.txt
.
I'm running sonar in maven - with the following plugin config:
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.0.1</version>
</plugin>
And the following command:
mvn -Dsonar.analysis.mode=preview -Dsonar.scm.enabled=false -Dsonar.scm-stats.enabled=false -Dsonar.working.directory=/mypath/target/.sonar
Now I expect the report-task.txt
to be created in /mypath/target/.sonar
but it is not.
SonarQube version: Version 5.5
My question is: Why doesn't my sonar scanner run create a report-task.txt file?
Go to your project folder which you want to scan. Create one new file inside your project's root folder path with name “sonar-project”. The extension of the file will be “.properties”. Add the following basic configurations inside “sonar-project.properties” file.
If a sonar-project.properties file cannot be created in the root directory of the project, there are several alternatives: The properties can be specified directly through the command line.
Scanner CLI is not able to analyze .NET projects. Please, use the SonarScanner for .NET. If you are running the SonarScanner for .NET, ensure that you are not hitting a known limitation.
Run SonarQube Scanner on your project. Now, you are all set for your scanning your code. Open “terminal.app” (for other OS Platform “Command prompt”), and from terminal, go to the folder path where your project code resides. Run this command to scan your code.
This is what is stopping it:
-Dsonar.analysis.mode=preview
You have to change it to:
-Dsonar.analysis.mode=
The assumption being you will have to upload bad builds and then trap them with a leak-period of 3 days instead of previous version.
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