SonarQube compatibility with Jenkins - sonarqube

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.

Related

How to configure Build braker plugin for sonarqube?

As of now I know sonar has dropped support for Build-braker plugin but I am trying to integrate build breaker plugin for sonarqube. I have 5.6 version of sonarqube and build breaker with 1.1 version installed.In Build breaker plugin I have setup sonar.buildbreaker.skip to false. And I run job using Jenkins and maven. for sonarqube analysis I have setup a phase as "prepare-package" where it runs automatically when I do mvn clean install. But, eventhough my quality gate shows failed, my build is still getting success rather than failing. I tried to find documentation but I didn't found better for this. https://docs.sonarqube.org/display/SONARQUBE45/Build+Breaker+Plugin

SonarQube Runner vs Scanner

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

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

SonarQube and Sonar runner installation in Jenkins

I have installed SonarQube-4.3 and Jenkins in my machine. To integrate Sonar with Jenkins installed the SonarQube plugin.
Do I need to install Sonar-runner in my machine in order to trigger a analysis through Jenkins?
You need SonarQube installed and running on same/different machine.
also you require SonarQube plugin in Jenkins which will connect SonarQube for Storing results.
Sonar-runner will be analyzer which will run analysis on your codebase.
You need to install sonar-runner on your local machine and have to specify its path in Jenkins system configuration.
Please find below the screenshots for detail purpose.

Unable to get sonar-fortify plugin configured with Jenkins and SonarQube

I have scoured the forums and cannot seem to quite understand the config for the fortify plug-in with Sonar.
I understand it simply builds a widget based on data from a previously generated .fpr file.
My setup:
Maven 3 project
Jenkins 1.606
SonarQube 5.0.1
Sonar-Fortify plug-in 2.0
Prerequisites:
.fpr file is in Jenkins workspace
Sonar is added to pom.xml
sonar-fortify-plug-in v2.0 added to pom.xml - (wasn’t sure this was needed or not)
Sonar server configured in Jenkins
sonar fortify plug-in v2.0 added to Sonar – (only see a dropdown to ‘enableReportLink’ under ‘Configure widgets’
should there be more config somewhere?
Questions:
Where should this property be set? Jenkins Sonar config, Sonar, pom file?
sonar-runner -Dsonar.fortify.reportPath=/path/to/project.fpr
Is that path to the .fpr file where it is within the Jenkins workspace?
The setup instructions on Github seem short and I feel I am missing something specific in my understanding.
Any help or direction to additional documentation is great appreciated.
First of all as documented version 2.0 can not be used anymore. Version 2.1 is going to be released soon. Vote for release will be started this week. Meanwhile you can:
download 2.1-SNAPSHOT version and copy it in extensions/plugins of your SonarQube server installation
restart server. The Fortify rules should be available in the page "Rules".
execute Fortify command "sourceanalyzer", independently from SonarQube. It generates a report file suffixed by .fpr.
execute a standard SonarQube analysis of your project by adding the property sonar.fortify.reportPath, for example:
mvn sonar:sonar -Dsonar.fortify.reportPath=/path/to/project.fpr
sonar-runner -Dsonar.fortify.reportPath=/path/to/project.fpr
If everything works, then you can automate these steps in Jenkins.

Resources