Project is empty at sonarqube - jenkins

Why after successful analysis at jenkin, my project is empty at sonarqube.
Console output at jenkin:-
Sonarqube scanner details:-
Sonarqube/localhost details:-

Install Swift plugin in sonar. By default sonar check only java code. Then run jenkins job again.

Related

Sonar scanner execution order jenkins job

For my project, we have made the job on Jenkins GUI. Non declarative.
Tasks are :-
GIT scm
Maven clean install goal
Sonar scanner
Quality gate
War to artifactory
I have defined, sonar scanner in post build steps and deploy to artifactory in post build actions.
Now in console output, order of execution is like war is getting published first and then sonar scanner runs code quality check.
However, i want sonar scanner to execute first.
Can someone please guide me on how i can achieve this ?
Are you using the Sonar Scanner for maven plugin?
https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-maven/
You should just be able to add 'sh mvn clean build sonar:sonar' in your Jenkins pipeline and the plugin will do the rest. It will run the unit test, run jacoco if you have it configured, and report it back to sonar.

Do Jenkins and SonarQube need to be on the same machine?

I am trying to run a SonarQube scan from Jenkins job. I have the SonarQube Scanner for Jenkins plugin installed v2.6.1 running on local Jenkins (for dev only);
I have seen conflicting reports on whether or not you can run SonarQube on a different server then Jenkins. It wouldn't make sense if you could not do that... if you can, instructions on how to accomplish it would be great. Simply putting in the URL to the SQ server where Jenkins expects a directory to Sonar Runner locally, does not work.
Jenkins and SonarQube do not have to be on the same machine.
The SonarQube plugin in Jenkins will run one of these three scanners:
SonarQube Scanner
SonarQube Scanner for Maven
SonarQube Scanner for MsBuild
Depending on which scanner you use, it works a bit differently:
For the SonarQube Scanner, pass -Dsonar.host.url=http://your.host:1234 as additional arguments. (or add it to your sonar.properties file)
For the SonarQube Scanner for Maven, add -Dsonar.host.url=http://your.host:1234 to your maven build step.
For the SonarQube Scanner for MsBuild, add /d:sonar.host.url=http://your.host:1234 to your MsBuild.exe call.

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable

I am trying to run the SonarQube Scanner within Jenkins as a post-build step. However, I keep getting the error message below:
------------------------------------------------------------------------
SONAR ANALYSIS FAILED
------------------------------------------------------------------------
FATAL: SonarQube Scanner executable was not found for SonarQube
Build step 'Execute SonarQube Scanner' marked build as failure
From similar questions on stackoverflow I read that one should choose "Install automatically" for the SonarQube Scanner, which I have done.
My configurations is as follows:
SonarQube 6.0
Jenkins 1.609.3
SonarQube Plugin 2.4.4
SonarQube Servers
SonarQube Scanner
Build-step
Make sure you are giving path in Global Tool Configuration correctly.
Give the path of folder in which bin folder is exists inside that folder.
Step1 : 1st find where the sonar_scanner bin is available -
root#test1sp117:/opt/sonar_scanner/sonar-scanner-3.0.3.778-linux# ls
bin conf jre lib
Step2 : Give the correct path in Manage Jenkins --> Global Tool Configuration --> SonarQube Scanner
You may want to ensure that both SonarQube and SonarQubeRunner are installed. You would need to configure the SonarQube Runner bin in the Tool Configuration of Jenkins and not the SonarQube server. This fix worked for us.
When you config SonarQube Scanner in Manage Jenkins --> Global Tool Configuration --> SonarQube Scanner, besides select "Install automatically", you also need to add a installer.
See screenshot here:
SonarQube Scanner --> Add Installer

SonarQube and Jenkins, issue with integration

I had integrated sonarqube with the jenkins by adding a plugging and changing the configuration. But after i build a project, the build is succeded but not analysis results are added to sonarqube UI. And I cannot click on SonarQube link in the project page after build. but if i run the sonarqube analysis without jenkins i get the results in the web UI.
the sonarqube was also injected to the build:
according to the console output.
Can you please help me to get my integration correct?
Best regads,
Nadis
Install SonarQube Runner and configure it with Jenkins under SonarQube Runner section (Go to Manage Jenkins ->Configure System).
For step by step information on "Configuring Sonar with Jenkins" follow this link.

Sonar Analysis using Jenkins can't find executable

I'm trying to trigger a sonar analysis of an android application through Jenkins and the Sonar Runner plugin. I've added a "Invoke Standalone Sonar Analysis" build step to my job that builds the code using Ant. When it gets to the Sonar Analysis step it fails and outputs the following:
------------------------------------------------------------------------
SONAR ANALYSIS FAILED
------------------------------------------------------------------------
FATAL: Sonar runner executable was not found for Sonar Runner 2.2.2
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
The jenkins agent is a remote linux server where I have installed the sonar-runner in /opt/ and have updated appropriate SONAR_RUNNER_HOME and PATH variables.
Have I installed the runner correctly? I've looked at the documentation and other similar installation related questions but have not found what my problem could be.
Make sure to set the path of the runner correctly in Jenkins. It's the path without */bin in the end. That's a little tricky.
In the Manage Jenkins section, Configure... did you set the Sonar Runner Installations correctly? Check box Install automatically and install automatically the version from Codehaus.
Install Sonar Runner in the same server where Jenkins has been installed.

Resources