SonarQube runner made error on Jenkins - jenkins

I use Jenkins and plugin SonarQube and Sonar runner.
For SonarQube Runner installation in Jenkins, it made Warning like this.
/home/abc/sonnar-runner-2.4 is not a directory on the Jenkins master (but perhaps it exists on some slaves)
of course I made /home/abc/ directory on the Jenkins Server.
so.. i ignore the warning and try to build tho..
it made error like this.
SONAR ANALYSIS FAILED
FATAL: SonarQube runner executable was not found for sonar-runner-2.4
Build step 'Invoke Standalone SonarQube Analysis' marked build as failure
Finished: FAILURE
i cant figure out this problem
is there anyone know how to solve this?

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

Related

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.

Unable to find build script on CloudBees Jenkins

Getting the following error on Jenkins hosted by CloudBees:
FATAL: Unable to find build script at /scratch/jenkins/workspace/PROJECTNAME/deploy_ci/build.xml deploy
Build step 'Invoke Ant' marked build as failure
Finished: FAILURE
That is executed by the following configuration in Jenkins
Build
Invoke Ant
Targets: -lib deploy_ci/lib/ant-salesforce.jar
Build File: deploy_ci/build.xml deploy
I can confirm that I have /deploy_ci/build.xml in my git repo.
If I'm doing something dumb, great. If there is a way to troubleshoot this more effectively on jenkins or cloudbees (new to both), I'm all ears.
Presumably the deploy belongs in Targets, not Build File.

No sonar-runner option in jenkins?

I'm looking to install sonarQube on our jenkins server.
The documentation i can find tells me to configure sonar-runner in
Jenkins --> manage Jenkins --> Configure system
however there is no 'sonar runner' option there.
There is a 'sonar' option where i configured my sonar server, and the sonar plugin is installed and up to date.
How do i get the sonar-runner configuration to show up?
(We want the standalone sonar job not the maven on as this is a project without maven.)
In newer versions of Jenkins (like 2.2), the sonarqube runner configuration is under
Manage Jenkins > Global Tool Configuration
Thats the solution :)
Ok. So, if I understand well:
Going into Manage Jenkins' -> 'Manage Plugin' -> tab 'Installed' in the Plugin manager, you can see 'Jenkins Sonar plugin' in the installed plugins.
--> Beware that there is a SonarGraph plugin that is not the proper one. Please verify you have this: http://i.stack.imgur.com/SNZLG.jpg
You say you can install the sonar server part in Jenkins. I understand you refer to this doc http://docs.codehaus.org/display/SONAR/Configuring+SonarQube+Jenkins+Plugin#ConfiguringSonarQubeJenkinsPlugin-AddingSonarQubeServer, and more specifically section 'Adding SonarQube Server' point 2 and 3.
--> Can you confirm that you have this 'Sonar' part under you Jenkins configuration ?
If yes to previous 1 & 2, you should also have the SonarQube Runner part available in Jenkins, as in the previous doc and the post on my blog.
--> Can you confirm this is the part that is lacking ?
Can you try this:
Jenkins -> New Job -> Select 'Build a free-style software project', enter a job Name -> click Ok.
Section Build -> 'Add build Step': can you see the 'Invoke standalone Sonar analysis' menu : http://i.stack.imgur.com/9TmFr.jpg ?
You have SonarQube runner installed and correctly configured: http://docs.codehaus.org/display/SONAR/Installing+and+Configuring+SonarQube+Runnerhttp://docs.codehaus.org/display/SONAR/Installing+and+Configuring+SonarQube+Runner
Do not hesitate to ask for further precision.
I can see both Sonar (just above E-mail Notification section) and Sonar Runner in Jenkins > Configure System section.
I have Jenkins 1.547 and Sonar Plugin 2.1 installed. However, please note that, as per this link, Jenkins 1.491+ and Sonar plugin 2.1 will suffice.
I faced similar issue.
Solution is that you need to run sonar-runner outside jenkins once and then restart jenkins.
To run sonar-runner outside jenkins. Download sonar-runner as mentioned in the steps #
http://docs.sonarqube.org/display/SONAR/Installing
Create a sonar-project.properties file at the root of you code base. below link describes the content of the file. http://docs.sonarqube.org/display/SONAR/Analyzing+with+SonarQube+Runner
Run sonar-runner.bat from the codebase.
Once the sonar analysis is done, Start Jenkins Jenkins will now show the sonar-runner option in configure page.

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