Sonar scanner plugin installation - sonarqube

I have sonar-scanner-3.0.0.702 in local and sonar qube v5.3 in remote server.
In my sonar config property i have mentioned as like below.
sonar.host.url=https://example.com/sonar
sonar.token=a2s3d4f4k57
sonar.login=someuser
sonar.password=somepassword
sonar.language=abc,xyz
When I run the sonar scanner by executing ..\bin\sonar-scanner.bat. I can see the jar's are getting downloaded from site and saved under cache folder(C:\Users\John.sonar\cache). But my custom languages jar will not be downlaoded and hence it is throwing error saying
`ERROR: Error during SonarQube Scanner execution
ERROR: You must install a plugin that supports the language 'abc,xyz'
1) How can i plugin my custom JAR files in sonar scanner to make it work ?
Note : I know the procedure to include custom jar file in sonar Qube (sonarqube-5.3\extensions\plugins).But how can we do it for sonar scanner ?
2) In my conf file, i have mentioned sonar.token and sonar.password. if i remove the password i am getting authentication error. Why sonar scanner not using token for authorization ? how can we overcome this error ?
ERROR: Not authorized. Please check the properties sonar.login and sonar.password

Related

I got 403 Error on SonarQube integration with Jenkins

Jenkins build errorFor one applications, builds are failing with a Sonar 403 error.
However, I could see the analysis reports being published.
I read on the internet that assigning browse permission would solve the problem.
However even after assigning the Projects Browse permissions, they still have a 403 error.
Also, when I change the project from Public to Private and manually run the builds, they are building successfully. My jenkins job is pipeline as code.
Sonarqube scanner MSBUild version: 4.0.2
Sonarqube server : 6.7
Jenkins : 2.107.2
Can you please help me with that?

Error during sonar runner execution

I set all properties. but when i run the sonar it shows error.
While it is working with another system which have same configuration.
The Error is below
error during sonar runner execution
fail to request server version
Caused by: Status returned by url:'http"//localhost:9000/api/server/version' is invalid :500
You don't specify whether you're using sonar-runner or Maven to run your analysis, but this looks like sonar.host.url may have a typo in it. Double-check that it's a valid, fully-formed URL.
EDIT:
For sonar-runner it's set in [install_directory]/conf/sonar-runner.properties
For Maven it's set in your settings.xml file

Maven with sonar authentication

I am running maven with sonar. Since I activated authentication on sonar for security purposes, since then I got the following error:
[ERROR] Can´t access to Sonar or project doesn't exist on Sonar instance. HTTP KO to http://localhost:9000/api/resources?resource=com.myproject.soft:soft&depth=0&format=xml
java.io.IOException: Can´t access to Sonar or project doesn't exist on Sonar instance.
at org.sonar.report.pdf.util.SonarAccess.getUrlAsDocument(SonarAccess.java:132)
at org.sonar.report.pdf.entity.Project.initializeProject(Project.java:98)
according to http://docs.sonarqube.org/display/SONAR/Analyzing+with+Maven I should use the following parameters:
-Dsonar.login=login -Dsonar.password=password
Those settings are not working for me.
The full command I am using is:
mvn install sonar:sonar -Dsonar.login=login -Dsonar.password=password
This is a limitation of the PDF Report Plugin that is developed by Klicap:
http://jira.codehaus.org/browse/SONARPLUGINS-1510
If you remove this plugin, then everything should be back to normal.
We have the same problem and resolved it by adding some credentials. Tested on Sonar 3.7 and Sonar PDF Plugin 1.3
In eclipse put this as your maven Goals:
org.codehaus.sonar-plugins.pdf-report:maven-pdfreport-plugin:1.3:generate -Dsonar.host.url=http://localhost:9000 -Dreport.type=executive -Dsonar.pdf.username=admin -Dsonar.pdf.password=admin

sonar query regarding configuration required in setting.xml

I have downloaded sonar and set it up
Want to analyze a project - so made changes related to plugin in pom and set up the URL for the sonar install as well as the database properties that sonar is using ( mysql )
My question :
Why do we need to specify the URL in the maven_home\conf\settings.xml ?
<sonar.host.url>http://localhost:9000</sonar.host.url>
Why is this required ?
My understanding is when I run the mvn sonar:sonar from my dos prompt - sonar plugin ( defined in pom . xml ) is analyzing and then inserting the data into the database - using the db information provided in the settings
what is the usage of above URL ?
Thanks,
satish
First of all that is the default URL. If specify nothing at all the Sonar plugin will assume that there is a sonar instance running locally on port 9000.
You are quite correct when sonar completes it's analysis it uploads all results into the database directly using JDBC. The URL parameter is required because the Sonar plugin also uses the Sonar REST API to retrieve information about your project when starting Sonar analysis.

hudson cobertura sonar integration error

I integrate sonar into hudson, but when I build a project using hudson, an error occured
log:
does anyone know how to avoid this error?
thanks in advance~
You have to change the location of you locale maven repository into a different location like c:.m2\ instead c:\Document Settgins etc........This can be done by changing the settings.xml file.
You have reached the limit in Windows...

Resources