Adding a new project to Sonar v.2.9 - sonarqube

I am using sonar to review my code for a java project. the version that I am using is v.2.9, I am using sonar for the first time. I have no idea how to add project in sonar server.
Please help on this
Thanks.

There's no option to "add" a project in Sonar from Sonar UI. Projects are automatically added to Sonar whenever a successful analysis occurs.
I'd suggest you the following :
Upgrade to a more recent Sonar version. http://www.sonarqube.org/downloads/
Read the analyzing source code guide where you can find instructions for all available methods to trigger a new analysis
Update : Sonarqube allows (I think after 5.x version) provisioning of projects as described in their documentation

With Administrator role, you can "Provision" a project.
Log in as administrator
Select Settings from the menu
Select System -> Provisioning from the sub-menu
Click Create (at the very far right of the frame)

It's pretty straight forward with the newest version. All you have to do is installing as the guide. And it will prompt a command which you need to execute with your build tool at the project folder.
For an example for maven it would be like
mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.login=4aa32e977ab1513e3fe5c3ac0c7883528d01a5e8.
With a command similar to this reports will be sent to the Sonarqube. And code analysis will be done

Related

TFS code analysis for java/maven projects

I have a brand new TFS2018 test installation and try to run a maven build with sonarqube analysis.
The sonarqube extension is installed from the marketplace and configured to use our internal Sonarqube. I added the prepare and publish SonarQube steps to my build like described.
In the prepare step I can successfully select my SonarQube endpoint from the drop down box.
When I now tick the "Use SonarQube" check box in my maven task the SonarQube-Endpoint drop-down box is empty. My SonarQube-Server "Heuboe" does not show up. Even if I type it in the box stays invalid.
Any hint what's going wrong? Does anybody now how to file an issue to SonarQube directly. I can view issues under: https://jira.sonarsource.com/browse/VSTS/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel
but I didn't find a way to report one.
The Maven task is expecting a Generic Endpoint. The SonarQube extension adds another type of endpoint specifically for SonarQube, which the built-in Maven task has no awareness of.
Version 2.* of the task (which should be selectable from the dropdown menu for the task) has another method of running SonarQube, which will use the endpoint defined in the Prepare Analysis step.

How to rename projects in Sonar Qube

I have a few projects which use pom.xmls to run the sonar analysis. Their names are:
Myproject1
Myproject2
Myproject3
Myproject4
I want to rename them on the sonar dashboard:
MyprojectA
MyprojectB
MyprojectC
MyprojectD
whats the simplest way to achieve this? I know that we can update the key, and then on-board the project with the desired name. Is it possible for me to use the same key and update the project display name?
P.S: I use sonarqube version 6.1
I had to eventually change the project name in the settings.xml file. This contained my sonar.projectname and sonar.projectkey. Then, I had to onboard the app on the sonar dashboard with the new details and run the analysis. However, i still feel that a simple renaming feature could have been easy.
Since it is more of an enterprise version of sonar we are not allowed to upgrade the sonar version immediately.

Issue Report Plugin not working in SonarQube 5.6.1

This is how i execute my sonar analysis,
mvn sonar:sonar -Dsonar.issuesReport.html.enable=true
In Sonar 4.0 i was able to generate HTML reports, But in SonarWube 5.6.1 its not working out (No errors thrown)
I have googled a lot and couldn't find an alternate plugin or any fix for this.
If some one can suggest me, that will be helpful
Take a look at SonarLint for Command Line. The functionality was moved there.
EDIT SonarLint for Command Line has been dropped. The recommendation is now to use SonarLint in your IDE or Branch Analysis, which is available in Developer Edition($)

SonarQube Eclipse Plugin manual download

I want to download SonarQube Eclipse plugin and install on Eclipse IDE manually.(I know it can be download through MarketPlace of Eclipse IDE, but I need to do manually.) Anyone knows where it is possible? Any official site available ?
1.) Go to Help > Eclipse Marketplace... and search for "SonarQube". If you are not finding SonarQube. Follow next steps
Go to Help > Install New Software... This should display the Install dialog box. Paste the Update Site URL (http://downloads.sonarsource.com/eclipse/eclipse/) into the field Work with and press Enter. This should display the list of available plugins and components.
2.) Check the component you wish to install (see Features details).
3.) Click Next. Eclipse will then check to see if there is any issue which would prevent a successful installation.
4.) Click Finish to begin the installation process.
5.) Once the installation process is finished, Eclipse will ask if you want to restart the IDE. It is strongly recommended that you restart the IDE.
Download from Bintray => https://bintray.com/sonarsource/SonarLint-for-Eclipse/releases/_latestVersion
The link is given at Sonarlint for Eclipse Homepage
In my experience SonarLint is not equivalent to SonarQube. When not bound to SonarQube it reports many errors we don't care about. Bound to our SonarQube it reported, for example, about 10 errors compared to 303 on our SonarQube. See this comment

sonar-3.5.1 deploying project on sonar server but code not showing

I have upgraded my sonar version from sonar-3.2 to sonar-3.5.1 and upgraded sonar-runner from sonar-runner-1.1 to sonar-runner-2.2.2, now when i am deploying project on newly installed sonar 3.5.1 it run successfully and showing ANALYSIS SUCCESSFUL, it also show project name on sonar server when i use localhost:9000 on browser but code is not showing there, no violations are coming etc.
i am using sonar in two ways and both results the same. Two ways are:
1. using sonar standalone through sonar runner from cmd.
2. integrating sonar with Jenkins(1.515) and using maven(3.0.4)
when i do sonar analysis on sonar 3.2 everything is working fine in both of the above cases but problem comes only when i use sonar 3.5.1.
Can anybody help me out on this issue??
Please suggest what would be the possible way to overcome this issue..
your revert will be appreciable.. Thanks in advance!!
Please refer below for logs
and sonar dashboard
So I do confirm that the Sonar Java plugins have been deleted from the extensions/plugins directory and that's why you don't get any measures/violations when analysing a java project. Here is the link to download version 1.2 of the Sonar Java plugin ecosystem : http://docs.codehaus.org/download/attachments/230396085/JavaEcosystem-1.2.zip. You just have to decompress this archive, place all jar(s) in the extensions/plugins directory and relaunch the Sonar server.

Resources