Why doesn't my sonar scanner run create a report-task.txt file?
Asked Answered
G

3

9

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?

Grigson answered 31/10, 2016 at 5:24 Comment(3)
What versions are you using?Clastic
SonarQube has posted a Why You Shouldn’t Use Build Breaker article. It seems that SonarQube 5.4 is last the version supporting it.Pylorectomy
That's an interesting article - I could say quite a bit about it. Let's assume for the purpose of this question I've already read it, and still need a build breaker solution.Grigson
G
6

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.

Grigson answered 27/11, 2016 at 3:14 Comment(2)
Why empty instead of "publish"?Northumberland
Where to add this in Jenkins?Scoliosis
I
0

If your version is greater than 6.6 use analysis parameter sonar.working.directory=path

Indeciduous answered 4/2, 2020 at 8:45 Comment(0)
K
0

I had the same issue of not finding the report where I expected, in my case it was because the default report path for sonar-maven-plugin:3.9.1+SonarQube server 9.9 was target/sonar/report-task.txt.

Kujawa answered 28/6, 2023 at 21:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.