SonarQube Scanners run the analyzers on code. Use this tag for questions related to any of the scanners: SonarQube Scanner for CLI, Maven, Gradle, Jenkins, etc.
Questions tagged [sonarqube-scan]
1464 questions
8
votes
0 answers
How to show test coverage, when using Spock to test Java code?
We have a Java project where the unit tests are written using Spock (Groovy). We use SonarQube for static analysis. However, we don't see the test coverage reported in SonarQube. But it lists the Groovy tests under Unit Tests section.
In SonarQube…

Yohan Liyanage
- 6,840
- 3
- 46
- 63
8
votes
0 answers
Differences between sonar-maven-plugin and sonar-scanner
We currently use the sonar-scanner utility to run sonar analysis on our maven multi-modules java project.
I wanted to move from the sonar-scanner to the sonar-maven-plugin, but the first tests shows a big discrepancy in the reported metrics.
For…

Julien
- 206
- 1
- 7
8
votes
2 answers
How does sonar:sonar work?
We want to use SonarQube with some CI tool in our project. Sonar Server url is configured in main pom.xml.
There are several team memebers in the project. So what happen when one team member executes sonar:sonar locally with his local changes, then…

RuF
- 548
- 1
- 11
- 31
8
votes
1 answer
Control module name with SonarQube Scanner for MSBuild
I tried to change the module name of a C# project by adding the following xml fragment to my csproj file:
Core.XY
This works…

Stefan Egli
- 17,398
- 3
- 54
- 75
8
votes
3 answers
Is it possible to use environment variable in sonar-project.properties file
I am executing sonar through Jenkins build, there is use-case where 'src' location changes depending upon build so i want to use environment variable for specifying 'src' path.
For example in sonar-project.properties i want to specify as shown…

Ganesh Rao B
- 461
- 2
- 8
- 23
8
votes
2 answers
SonarQube analysis mode: preview vs issues
Which are the key differences between these preview and issues modes of SonarQube (greater than 5.2) analysis?
Considering http://docs.sonarqube.org/display/SONAR/Concepts the main differences between publish and preview is that preview reports…

Radu Dumbrăveanu
- 1,266
- 1
- 22
- 32
7
votes
1 answer
SonarScanner giving 'MsBuild.exe' is not recognized as an internal or external command on TFS 2018
I'm adding SonarQube to existing TFS 2018 builds. I was following the directions for downloading Community Edition 7.4 located here https://docs.sonarqube.org/display/SCAN/Install+the+SonarScanner+for+MSBuild.
Going through the steps of the Quick…

Edyoke211
- 71
- 1
- 1
- 2
7
votes
2 answers
Sonarqube PLSQL Custom rule for detecting correct SQL terminator semicolon within a SQL script file
I am using Jenkins and SONARQUBE PL/SQL plugin for Oracle SQL code analysis,
I need to create Custom rules using XPATH for Quality Analysis of the SQL Script files that are sent for deployment over Jenkins.
I am trying to create a custom rule that…

aejaz
- 105
- 1
- 10
7
votes
0 answers
Make SonarQube Gradle plugin available in root project and subprojects
When using Maven with a multi-module project I can simply add the Sonar plugin to the parent POM:
org.sonarsource.scanner.maven
sonar-maven-plugin
…

Helder Pereira
- 5,522
- 2
- 35
- 52
7
votes
1 answer
Sonarqube v.4 TFS task "Publish Analysis Result" throw error "Could not fetch metrics"
On TFS, I am not being able to run the taks "Publish Analysis Result" to publish Quality Gate on TFS web page. The other tasks "Prepare analysis on SonarQube" and "Run Code Analysis" runs successfully.
The error messages are:
[error][SQ] Could not…

Igor Paladino
- 159
- 6
7
votes
2 answers
How to run sonar scanner on an Ionic 2 project
We have migrated our frontend project from ionic/es6/angular to ionic2/typescript/angular2. Everything is good except we don't know how to run sonar report on the project.
Previously we are using gulp and run gulp sonar command to generate the sonar…

Gelin Luo
- 14,035
- 27
- 86
- 139
7
votes
1 answer
How to speed up sonarqube analysis job?
I have one java based application which is having huge line of source code(~1m).Now I am using jenkins with sonar-runner-2.4 to run analysis with code coverage and test cases count.I have upgraded sonarqube server from 5.4 to 6.3.1.Before upgrade…

chintan thakar
- 1,440
- 1
- 15
- 25
7
votes
2 answers
SonarQube Scanner analysis skipped in travis CI
Does anyone knows for which reasons a SonarQube Scanner analysis could be skipped ?
$ sonar-scanner -X -Dsonar.host.url=https://sonarqube.com -Dsonar.login=$SONAR_TOKEN
08:59:10.162 INFO: Scanner configuration file:…

vhamon
- 637
- 4
- 12
7
votes
4 answers
How to react on SonarQube Quality Gate within Jenkins Pipeline
Within my Jenkins Pipeline I need to react on the SonarQube Quality Gate.
Is there an easier way to achieve this but looking in the Sonar-Scanner log for the result page (e.g. https://mysonarserver/sonar/api/ce/task?id=xxxx) and parse the JSON…

Christoph Forster
- 1,728
- 4
- 27
- 39
7
votes
7 answers
Not authorized to execute any sonarqube analysis with sonarqube scanner on Travis CI
I recently started using Travis CI and sonarqube in an open source project and have run into a problem with sonarqube-scanner.
My Travis CI page can be seen here: https://travis-ci.org/uglyoldbob/decompiler
My sonarqube page can be seen here:…

uglyoldbob
- 143
- 1
- 1
- 9