HomeОбразованиеRelated VideosMore From: Siva Reddy

SonarQube Installation and Analyse Sonar Qube report for Basic Java Project

383 ratings | 114327 views
For any java/devops/developer/lead position related interview assistance/guidance/help, you can reach out me @ [email protected] In this vedio, I have explained how to setup SonarQube on computer and analyze sonarqube report for Basic Java Project SonarQube server download url: https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-5.4.zip scanners download URL: https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-2.6.1.zip
Html code for embedding videos on your blog
Text Comments (122)
Sachin Mali (1 month ago)
The project which i want to analyze, is having multiple java files. But while analyzing i m getting an issue saying ERROR: Error during SonarQube Scanner execution ERROR: Please provide compiled classes of your project with sonar.java.binaries property ERROR: ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging The same is working fine when i analyze the single java file. SonarQube Server version : 6.7.7 Sonar-Scanner version : 3.3 plz help
Siva Reddy (29 days ago)
You are welcome. Please refer our YouTube channel to your friends circle as it might be helpful for them. Happy Learning.
Sachin Mali (1 month ago)
+Siva Reddy Thank u sir ☺
Siva Reddy (1 month ago)
Provide sonar.java.binaries = <path to bin folder for the Java classes>
Kiran reddy (1 month ago)
sonar.exclusions how to do configure esclusinon and inclusion inn maven pom.xml
Siva Reddy (1 month ago)
You can exclude files using pom.xml under <properties> <sonar.execlusions>**/*Test.java</sonar.exclusions></properties>
Hassan Shamshir (1 month ago)
Code can not be delivered to SonarQube from jenkins.
Hassan Shamshir (1 month ago)
I face a problem while integrating jenkins and sonarqube container.
Hassan Shamshir (1 month ago)
Why evey person made a tutorial on sonarqube for java code.
Federico De Luca (1 month ago)
Thanks for the explanation!
Rahul Desai (2 months ago)
I have an issue with SonarStart.bat It gives the following error: jvm 1 | 2019.03.04 12:22:28 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running jvm 1 | 2019.03.04 12:22:29 INFO app[][o.e.p.PluginsService] no modules loaded jvm 1 | 2019.03.04 12:22:29 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin] jvm 1 | 2019.03.04 12:22:44 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1 jvm 1 | 2019.03.04 12:22:44 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped jvm 1 | 2019.03.04 12:22:44 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped wrapper | <-- Wrapper Stopped Im guessing it has something to do with Elastic Search. Does anyone have a solution?
Siva Reddy (2 months ago)
It could be issue due to another sonarqube process already running in background with same ports. Please try after restarting your computer.
mokshavathi p (2 months ago)
I am using Sonarqube 5.2, scm git plugin jar 1.1 , i am facing issue with issue automatic assignment. Issues are not assigning automatically in sonar. Please help me how to solve this, its blocking team
Anil Charugundla (3 months ago)
Very simple but effective explanation . Are you planning on making more videos on how you can automate this scanning as soon as the code is pushed to Git/Bit?
Siva Reddy (1 month ago)
Thanks Anil.will do. Please refer our YouTube channel to your friends circle as it might be helpful for them. Happy Learning
mahesh gandikota (4 months ago)
Sir, In Windows good but how to install in Linux machine?? Thanks in advance
Siva Reddy (4 months ago)
Thanks Mahesh. In Linux also after extract the sonar scanner folder or you can find the same sonar-scanner.properties file and you need add same sonar properties for your project
Rob Silver (5 months ago)
next time please stop the video wait till the server comes up please restart it after
Siva Reddy (5 months ago)
Thanks Rob for the feedback. Will take of it in future upload.
gangireddy thallapalli (6 months ago)
hi bro,links are asking authentication required?
Siva Reddy (6 months ago)
To download the Sonarqube server , it doesn't ask authentication. Download community edition.
gangireddy thallapalli (6 months ago)
what are the latest versions?
Siva Reddy (6 months ago)
SonarQube 7.3
Gaurav Nathani (6 months ago)
Hi Siva, gone through your video it looks good and worked for me as well. Just one query I have, I want to analysis multiple projects, in that case do I need to setup multiple sonar-scanner.properties files to indicate multiple ProjectKeys/source directories or how it is going to work?
prathap naidu (6 months ago)
Is it only work with Java code ?Can we run PL/SQL code..
Siva Reddy (6 months ago)
Sonarqube works even for plsql as well.
Karthik Reddy (7 months ago)
can you please make a video for latest version on sonarQube and SonarScanner and how we run java source file in to it.
Syllaba Abou Ndiaye (7 months ago)
when i run sonnar-runner.bat i have this error: JAVA_HOME exists but does not point to a valid java home folder. No "\bin\java.exe" file can be found there
Chandra Sekhar (8 months ago)
Where we have to add those sonar properties
pritam gudekar (9 months ago)
Can you provide the video to how to link sonarlint with sonarQube or rather I want to get solarLint report to be download for frontend codebase. Appreciates your help in this regards.
theivam123 (9 months ago)
Good Job, Siva. Keep it up !!!
Siva Reddy (1 month ago)
Thanks you. Please refer our YouTube channel to your friends circle as it might be helpful for them. Happy Learning.
Lakshmi Prasanna (9 months ago)
its really solved my problem that I am struggling with SonarQube since last 4 days
Siva Reddy (1 month ago)
Thanks Lakshmi. Please refer our YouTube channel to your friends circle as it might be helpful for them. Happy Learning.
Hemanth Kolla (10 months ago)
It is applicable for dotnet project?
Asmita Bhor (10 months ago)
hi..I have followed same procedure for c# project and I am getting successful message . but the sonar server is showing zero bugs , zero code line scans basically it's not giving result for c# solution...does there is any other configuration needed for c# ? thanks
Siva Reddy (10 months ago)
Hi Asmita, I did not work on c#, please refer url and see if this helps you to solve your problem @ https://github.com/SonarSource/sonar-csharp/issues/1277
Siva Reddy (10 months ago)
Hi Asmita, I did not work on c#, please refer url and see if this helps you to solve your problem @ https://github.com/SonarSource/sonar-csharp/issues/1277
Neha Mehta (11 months ago)
Siva Reddy (11 months ago)
Thanks Neha. Please refer our channel to your friends circle as it might helpful for them. Happy Learning.
can you please provide download links
more over how can add this sonarqube in my ant project(group of projects)
Anil Nagaraj (11 months ago)
Hi, could you please make a video for sonar qube for .NET project
inampudi yogesh (1 year ago)
I am facing an error of ' Project root configuration file:NONE ' , how to set that Project root configuration file
Michael (1 year ago)
Fucking life saver
Akhtar Munir (1 year ago)
when i run sonar-scanner.bat command, it show an error : please provide compiled classes of your java project with sonar.java.binaries property, What does this mean how can i resolve it?
Siva Reddy (1 year ago)
You need to set path to binary class/jar file path in sonar properties file: sonar.java.binaries = <Your binary classes/jar file for your project>
Ondrej Sakala (1 year ago)
Thanks for video. Very helpful.
Siva Reddy (1 year ago)
Thanks Ondrej.
Hi Siva Reddy, Thanks for your video. I need step by step process for set up SonarQube on computer and please let me how to link Cobol program with SonarQube. Since we are using Cobol 85. My email id is [email protected] if you could send me mail it would be grateful us . Thanks in advance. Mobile Number : (0)9884091848
Siva Reddy (1 year ago)
Hi, Please go through this url @https://docs.sonarqube.org/display/PLUG/SonarCOBOL and let me know if any further help required.
Aleksandra Ikonnikova (1 year ago)
Logged in just to be able to like your video :) really concise, thank you!
Siva Reddy (1 year ago)
Thanks Aleksandra Ikonnikova. Please do suggest our channel to your friends circle as well as it might help them. Happy Learning.
Pratik Rai (1 year ago)
I have followed the same process but I am getting error as No Quality profiles Kindly Help me out Siva
Dinesh kumar.P.S (1 year ago)
Hi Siva, i am want to use for PL/SQL.i just download plugin from SonarQube site and place into $SONARQUBE_HOME/extensions/plugins.then i restart the SonarQube it not at all up.but when i remove the PL/SQL plugin it working fine. Could you please help?
Suresh A (1 year ago)
at 15:10, before running 'sonar-runner.bat' from JavaProject directory, i can see ".sonar" . But ".sonar" is not available in my folder structure..... pls help me with this
Suresh A (1 year ago)
Abhijeet Kaushik , i actually had issues with projectKey & immediately after correcting it, everything went well ! I didn't even add project.language to the properties file
Abhijeet Kaushik (1 year ago)
Add sonar.language = java in conf file Then copy that conf file into your workspace , then it should work
Abhijeet Kaushik (1 year ago)
Suresh A I face same error, did you get any solution
Srilakshmi Pavuluri (1 year ago)
Hi Shiva, I am facing an error like code coverage is always showing as 0.0 % could please help me out regarding this issue.. Thanks in advance.
Siva Reddy (1 year ago)
Hi Srilakshmi, Could you please share the sample project for which you are generating the code coverage. I will help you regarding this issue.
lakshmipooja kolan (1 year ago)
Hey can you give me steps to run analysis for java script file?
Siva Reddy (1 year ago)
Hi Lakshmi - You need to add SonarJS plugin to your sonarqube and run the analysis. Please go through this url(https://docs.sonarqube.org/display/PLUG/SonarJS), it has steps to run analysis for Java Script files.
Sreekanth Reddy (1 year ago)
Hi Siva, Thanks for video. I have quick question! How to send the jacoco.exec to sonarqube that generated in tomcat. javaagent:C:\application\lib\jacoco.jar=destfile=C:\application\build\jacoco.exec,append=true,includes=.*,jmx=true
Cinthia ramos herrera (1 year ago)
Shiv Kumar (1 year ago)
Hi Siva, Could you help me how to generate reports in sonarqube currently using 6.2 version
Premakumar Tatireddy (1 year ago)
Nice explanation about sonarQube for beginners. Thank you, Sir
Siva Reddy (1 year ago)
Thanks Premakumar
dhas joshua (1 year ago)
This is very helpful for me
Piyumali Ganasinghe (1 year ago)
Sir, I got bellow error at the step of connecting project with sonarQube. what shoud I do? PS F:\Eclipse_Workspace\TulipsGarden> sonar-runner.bat sonar-runner.bat : The term 'sonar-runner.bat' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + sonar-runner.bat + ~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (sonar-runner.bat:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS F:\Eclipse_Workspace\TulipsGarden>
Julian Wilden (1 year ago)
You could tell us how you solved your Problem. Other might have it as well
Piyumali Ganasinghe (1 year ago)
I resolved it. thank you for this helpful video.
Huy Tranquang (1 year ago)
Can I do this way if I'm using IntelliJ .
Siva Reddy (1 year ago)
Yes. You can.
himansu sekhar rath (1 year ago)
i have one small doubt ..?u r using sonar-scanner or sonar-runner and what is the difference ..?i am getting build failure and it is asking to define mandatory property sonar.projectVersion ..i configured it but i am getting this exception.
Mayur Kapoor (1 year ago)
Hi, I have made changes into sonar scanner properties file as explained but still getting error while sonar runner execution. Caused by: You must define the following mandatory properties for 'Unknown' : sonar.projectKey, sonar.sources
Phani Sankar (1 year ago)
Really helpful. Thank You. :)
Siva Reddy (1 year ago)
Thanks Phani.
venkat katta (1 year ago)
Hi sivareddy, i am using reactjs frame work and build tool is gradle.i am having two Questions 1.how to compile js files, is it possible or not ? 2.Generate the sonar reports like html,xml and send it to particular persion? by using the gradle...
Vladwoguer Bezerra (1 year ago)
Thank you :)
Siva Reddy (1 year ago)
Thank you Vladwoguer
Szabolcs Kovacs (1 year ago)
Well done, how can I feed sonarqube with one big project, means all in one slice? I have outof memory issues.. thx
Siva Reddy (1 year ago)
Thanks for the update!! Just to add one point here. When we use latest version of the Sonarqube server, Please make sure that we need to use latest sonar plugin for gradle/maven build tool so that it might solve these type of issues.
Szabolcs Kovacs (1 year ago)
Thanks for responding, finally I was able to feed the SonaQube with one big slice using SonarQube 5.3 LTS. The newest 6.3 version has some bug because it always throws some internal 500 error message along with OutOfMemoryError. In other words, it couldn't handle to add that big project into the web service. However, modularizing the project was alright, but my task was to manage as one piece. So the latest not always the greatest! :D
Siva Reddy (1 year ago)
Hi, Did you install the sonarqube server on local computer or server? There are multiple options to fix OutOfMemoryIssues: 1) Make sure have you enough hardware configuration based on the project size. 2) Try to don't run the Junit test cases/Integration as part of sonar qube analysis 3) Divide the big project into modules and run them as individual projects 4) Don't run other programs in background while you are analysing the source code on sonarqube server
Mussie Estifanos (2 years ago)
Thank you for your tutorial. could you tell me how do you scan java classes or jar files if you do not have the source code?
Siva Reddy (2 years ago)
If you don't have the source code then you might have to use Findbugs plugin as your byte code analyser tool which analyse byte code and provide the code quality issues.
Vishwanath Manchala (2 years ago)
Hi Shiva Reddy, I am running "mvn sonar:sonar" target to perform sonar analysis from maven. Initially, I have provided sonar server and credentials in pom.xml file and was able to run it. Next, I have commented the sonar configuration details in pom.xml file. But still I am able to perform it. Could you plz tell me how sonar:sonar target is performing sonar analysis without having sonarqube server details. Any inputs are appreciated.
Siva Reddy (2 years ago)
Vishwanath - You need to enable security configuration for forcing the authentication before sonarqube process the analysis. By default, sonarqube does not authenticate user credentials for the sonar analysis. You can this change the setting by navigating to http://localhost:9000/settings?category=security and update force user authentication as "true"
Vishwanath Manchala (2 years ago)
Thanks Siva Reddy. Nice video. In sonar.sources property, you are defining the path till .java file available. Could you please help me to provide at the src level so that all java files across all packages to be compiled?
Vishwanath Manchala (2 years ago)
Thank you
Siva Reddy (2 years ago)
Hi Vishwanath - You can set sonar.sources property to sonar.sources='/src' either relative path or absolute path to src.
jyothi bodapati (2 years ago)
Can you provide guidance on verification of sonar for python projects.
Siva Reddy (2 years ago)
Jyothi -You need to add SonarPython plug-in in sonarqube server. Please go through this URL @https://docs.sonarqube.org/display/PLUG/SonarPython and let me know if you still requires any further assistance for the same.
Hi Siva, Its nice video. I have setup sonarqube and all my project code now is being analyzed by Default Quality GatesSonarQube and getting the results in Project explorer. Now requirement: 1. I want to setup/ integrate Fortify, Cobertura, Findbugs in order to see results as part of project in a single place. But I stuck in "Installing required plugins manually". 2. How to configure database other than h2 It would be helpful, If you could upload some related videos. Thanks.
tushar motwani (11 months ago)
Hi Faizur can you please help me with installation am unable to do
Siva Reddy (2 years ago)
Thanks Faizur. I will upload videos related adding the plugins like findbugs and cobertura in sonarqube as early as possible. Please stay tuned.!!
raksha dhruna (2 years ago)
Nice video. To analyse basic c/cpp project, should i follow similar process?
Siva Reddy (2 years ago)
You need to add plugin SonarCFamily to analyze the source code for c/cpp project. For more details refer the link :https://docs.sonarqube.org/pages/viewpage.action?pageId=7996665
Madhu Kalisetty (2 years ago)
Hi Reddy, i have been running sonar analayis for a project which consists of three versions. my doubt is when i run project for first time its lisiting the bugs present in that version. so wen i run another version of that project we vl get options like bugs in the left side and new bugs in the right side. I feel like new bugs are the new ones which are generated in the new version . But am still getting same bugs count in new bugs thus bugs in left side and new bugs are same . for example for frst time anaysis i have got some 1 k of bugs and when i run next version consider i hav got some 200 bugs in second version now in the project aftr analysis of two versions it should show 1200 in bugs and 200 in new bugs but i am geeting 1200 in bugs and 1200 in new bugs. tht compltey insane .. can u help me plssssssssssss
Madhu Kalisetty (2 years ago)
Hi, need some info reagrding andriod proejcts. to analyse andriod projects i have added andrio lint plugin version1.1. but if i put andriod lint as my profile its not giving even a single issue (bugs). i have tried all d ways and ended up. pls help me asap. do andriod lint working or not ?
Siva Reddy (2 years ago)
Please check sonar project properties. Is sonar.soruces property pointing to root folder of your project where it contains both java script code and andriod code? Mostly it seems to be sonar unable to find the source code for the andriod. Otherwise create two separate projects in sonar 1) related to Java script code 2) andriod code and run sonar analysis for both the projects and see if sonar able to finds the bugs related to andriod
Madhu Kalisetty (2 years ago)
Thanks a ton Reddy for info. I have one more doubt regarding Andriod projetcs. I have a andriod App which contains code of javascript, css and HTML when i run this project for anlaysis using Andriod lint i can see bugs only related to javascript css and in andriod code only java related bugs are showing up. I have alredy installed andriod sdk in sonarqube ruuning machine but still no andriod bugs listing out. Could you please tell me whats the problem and what to be done for listing andriod related bugs.
Siva Reddy (2 years ago)
Sonar always shows bugs based on the analysis last run. Currently you are not fixing any sonar reported issues in three versions. If you don't fix any sonar issues before sonar analysis for the second time, it will add the bug count (bugs find in the first run + bugs find in the second run). So in order to see the correct count, you must have fixed the issues reported in the revision 1, then when you run analysis in revision 2 will be having less count. Hope this might help you.
shruti mishra (2 years ago)
Very Nice Video.Please upload video for Soanr setup on Jenkins and how to add Java Custom Rule
Kishore Kumar (2 years ago)
very helpful, thank you for your tutorial .
V S (2 years ago)
Hey Siva, Thanks for the video. How do you manage multiple projects in sonar-scanner.properties. you have defined your JavaProject in this video with its source and version but when you have multiple projects you can't keep adding the properties for every project. Thanks in Advance
V S (2 years ago)
Makes sense. Would you be able to upload a tutorial on how to integrate sonar in a node.js project? I am also looking for a way to upload lcov reports to sonar for an angular project. Thanks!!
Siva Reddy (2 years ago)
Hi VS, Generally we use sonar scanner with any one of the build tools(ant, maven, gradle). So we will specify the sonar properties for the project in ant/maven/gradle configuration file instead of keep adding them in sonar-scanner.properties file. you need to add project in sonar-scanner.properties file if you are not using sonar with the any build tools.
vittal kamkar (2 years ago)
How to exclude the directories in property files..
Siva Reddy (2 years ago)
Hi Vittal - You need to create different modules based on your project requirement and then you can specify only the module which you want to analyse as part of the sonar scanner.
Suhas Lalige (2 years ago)
How to get report in pdf from sonarqube server
Siva Reddy (2 years ago)
Suhas - You need to add an plugin to export sonarqube in pdf format. Please go through this url: http://docs.sonarqube.org/display/SONARQUBE44/PDF+Plugin
Vishal Shah (2 years ago)
how to export the analysis report from sonar-qube server. report plugin is deprecated now....is there anyway?
vignesh war (2 years ago)
Nice Explanation . Wonderful Explanation
shivangini rathore (2 years ago)
Nice video. Could you please upload a video explaining how to add java custom rules in sonarqube
Peter Rangelov (2 years ago)
Please post links in the description
Siva Reddy (2 years ago)
sonar scanner URL: https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-2.6.1.zip Sonarqube server url: https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-5.4.zip
rishikesh kumar (2 years ago)
Nice video! Please upload more videos using Maven and integration with jenkins.
luân trần thành (2 years ago)
i think you should go to the source of project and put shift + right click, then chose open command windown here...and type sonar-runner. if you clickinto file sonar-runner.bat there are no data to show
Siva Reddy (2 years ago)
Sonar scanner integration with Jenkins URL - https://www.youtube.com/watch?v=munqThB8XQY
Siva Reddy (2 years ago)
Sonar scanner for Maven URL - https://www.youtube.com/watch?v=KX2FFmDPXD4

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.