SonarQube Runner vs Scanner - sonarqube

What is the difference btw Sonar Runner and Sonar Scanner?.
And which version of "Sonarqube" and Sonar runner is required for JDK7?

Answer is very simple: "Runner" is the old name for "Scanner".
Everything you need to know about the different SonarQube Scanners is available on the Scanners part of the official documentation.
If you're stuck to Java 7, then you can use:
SonarQube Runner (sonar-runner) up to version 5.5 of SonarQube
SonarQube Scanner (sonar-scanner) 2.6.1

Related

SonarQube Maven Analysis is not available in jenkins job UI

versions:
jenkins: 1.651.1
sonarqube: 6.0
jenkins plugin "SonarQube Scanner for Jenkins" 2.3
manage jenkins: section sonarqube instance config:
sonarqube runner configs:
I only see MSBuild scanner in build-step config of a job:
I suspect this is due to old version of jenkins and old jenkins sonarqube scanner plugin. Can you please confirm. Or I missing something here?
As stated in the docs, you're going to use a standard Maven step for this.

SonarQube compatibility with Jenkins

We are using sonarqube(5.1.2) and jenkins(2.51) to run code analysis. Now we are planning to upgrade sonarqube to version 5.6.4.
Do we also need to upgrade Jenkins ?
No you don't have to.
Sonar is an independent tool, Jenkins is responsible only for running maven/gradle script, that will 'feed' sonar with data. Just make sure you have same credentials for new sonar and it should be fine.
You could consider upgrading Sonar plugin version also.
Just check whether the sonar plugin installed in Jenkins will support the new Sonarqube version else you will have to upgrade the plugin.

Uploading Spock/Groovy test results into Sonarqube

There was a known issue from 2014 that UnitTests written in Groovy cannot have their PASS/FAIL metrics uploaded into SonarQube.
http://sonarqube-archive.15.x6.nabble.com/Resource-not-found-for-Groovy-unit-tests-td5024669.html
Does anyone know if this issue is fixed? I am still have the issue with Sonar 6.1 using Spock unit tests and Gradle build system.
Any clue on the correct gradle sonar settings to make this happen?
The solution for us was to install the Groovy plugin in Sonarqube 6.1.
Once the plugin was installed, we could see the tests, with this command line:
./gradlew sonarqube -Dsonar.tests=src/test/groovy -Dsonar.junit.reportsPath=build/test-results/test/
We are using Spock as well (with Gradle, as you can see)

How to use SCM Activity plugin in sonar for clearcase

Changed my sonar for scm activity from 3.7 to sonarqube 5.1.1 as it has in built in scm plugin.
Not getting what are the configurations needed to run that and what to pass in
setting->genral setting->scm->sonar.scm.provider
I found this link
http://maven.apache.org/scm/clearcase.html
and created a
URL:- scm:clearcase:baxi_view_4:clinical
Error
org.apache.maven.plugin.MojoExecutionException: SCM provider was set to "scm:clearcase:baxi_view_4:clinical" but no SCM provider found for this key. Supported SCM providers are git,svn
and what other changes or configuration needed in my code or is there anything i have to specify in pom.xml.
I am using jenkins and sonar Integration for CI and reports
You have to install ClearCase plugin for SonarQube. Since there is no official release download a SNAPSHOT from:
https://github.com/SonarCommunity/sonar-scm-clearcase/releases/download/1.0-rc1/sonar-scm-clearcase-plugin-1.0-SNAPSHOT.jar
Plugin documentation is here:
http://docs.sonarqube.org/display/PLUG/ClearCase+Plugin
Make sure to add sonar.scm.provider=clearcase into sonar.properties and re-run SonarQube analysis.
N.B.: We are waiting for positive feedback (on SonarQube Google group) before doing an official release since we do not have Clearcase instance for testing.
Install ClearCase plugin for SonarQube. Download and compile it from:
http://github.com/SonarCommunity/sonar-scm-clearcase
Make sure to add sonar.scm.provider=clearcase into sonar.properties and re-run Sonar analysis.
The machine which runs Jenkins should have ClearCase. And make sure Jenkins can run cleartool command from console.
Thanks #Julien H. - SonarSource Team
For running SonarQube with JRE 7:
From SonarQube page:
The SonarQube Java analyser is able to analyse any kind of java source files whatever is the version of Java they comply to. But SonarQube analysis and SonarQube server require some specific versions of the JVM to be executed.
We can install many JRE versions on our machine. For SonarQube, just set the JRE variable before run it.
Example on Linux
export JRE_1.7=/opt/jre_1.7
export PATH=$JRE_1.7/bin:$PATH
java -version
/opt/sonar/sonarqube-5.1.1/bin/sonar.sh start

Using findbugs plugin in sonarqube for java-8 and java-6

I need to use FindBugs 3.0 in Sonar qube for project running in Java-8 , the sonar server is shared by projects running java-6. (FindBugs 3.0 requires Java-7 to run) Is there any solution?
Java 7 is required to run analyses, but you can still analyze Java 6 code with FindBugs 3.0.

Resources