Using SonarQube in Eclipse - eclipse

I just installed SonarQube in Eclipse, but I don't know how to use it :
Here It said:
Link projects to Sonar server
What is the server? Should we create another project somewhere else with the same name as the project in Eclipse?
It's really confusing, I will appreciate if someone could help by a small example.

To be able to use Sonar Eclipse, you first need to install a Sonar server 5.1 or older as described here: http://docs.sonarqube.org/display/SONAR/SonarQube+in+Eclipse
Then, you will have to run a first analysis (out of Eclipse) of your project to have it referenced in the Sonar server. See http://docs.sonarqube.org/display/SONAR/Analyzing+Source+Code
After those 2 steps, then you'll be able to run analyses directly within Eclipse once you have associated your local project with the Sonar server.
UPDATE:
Sonar 5.2+ is no longer supporting sonar eclipse plugin in favor of sonarlint. Unfortunately sonarlint has no customization options.
We will make this feature available in upcoming versions, probably by
requiring to "connect" SonarLint with an existing SonarQube server
instance.

Sonar can be run now localy to analyse the java project
for more information visit sonar eclipse
Eclipse update site
Installation guide
Eclipse marketplace
Also you can visit DZONE for step by step installation procedure

Related

Sonar Lint Eclipse Issue

I'm using Eclipse Neon and SonarQube 5.6.6(LTS). I've install sonarLint version 3.1.0. Following are my question.
In SonarLint whether there is an option to analyze the entire project? I can't able to find such option.
The issue showing in Eclipse reported by sonar lint is different from reported on server. When I'm wantedly creating the sonar issues(based on the rule) in eclipse but SonarLint is not recognizing . why?
From Eclipse I've made the connection to the SonarQube server and the connection was success, Whether it is using the activated quality profile rule?
After resolving the issues, how the issues will be reflected to the sonarQube server ? In case of Maven whether I need to add the sonar properties and sonar-maven plugin and trigger the build?
1. Select your project and in Eclipse's Quick Access, select Analyze - Analyze with SonarLint. You can also assign a keyboard shortcut to this action by going to Window -> Preferences -> General -> Keys.
2. It seems as if you are not running in connected mode. Connecting a SonarQube server is not enough, you also have to bind individual projects. To do this, right click on your project in Eclipse, and select SonarLint -> Bind to a SonarQube project... Search for the name of your project on the server by typing in the box under SonarQube project, as show in the following screenshot:
Once connected, a SonarQube symbol should appear on your project's icon in Eclipse.
3. Once connected, the quality profile of your SonarQube server project will be used.
4. SonarLint only provides on the fly feedback, but does not trigger any analysis server side. Personally I have a clean verify sonar:sonar Maven run configuration for my projects, and run it every now and again within Eclipse.
I recommend reading the SonarLint documentation for more information.
I personally recommend either to change your version or to be sure which configuration really applies to your machine. I had similar problem when i tried to associate my local project with the project name on Sonarqube Server . I was using Eclipse IDE for C/C++ Developers Version: Luna Service Release 2 (4.4.2) with Sonarlint version 4.0 . I uninstalled it(sonarlint) and installed the Sonarlint 3.6 version. After this i could associate my project with Sonarqube Server.
Hope it Helps the main question.

difference between sonar and sonarqube

Can anybody explain me what is the difference between sonar and sonarQube as i have said to integrate the sonar with eclipse i am using eclipse Luna but when i tried to search sonar using
Help----> Eclipse Marketplace ---->search (sonar)
i am getting sonarQube not sonar
Therefore my question is that are they same or different if same i can go ahead to install in the eclipse if not then from where to install sonar as it is my requirement.please anybody suggest
SonarQube (formerly just "Sonar") is a server-based system. Of course you can install it on your local machine (the hardware requirements are minimal). But it is a central server with a database.
Analyses are performed by some Sonar "client" software, which could be the sonar runner, the sonar ant task, the sonar Eclipse plugin etc. The analysis results can be automatically uploaded to the server, where they can be accessed via the sonar Web application.
In an environment with many developers, you should run a build server (e.g. Hudson or Jenkins), which performs automatic sonar analyses as part of the nightly build. Other schedules are possible, but the developers should know when they can expect updates of the server-side analysis results. The results of the automated analysis can be displayed in the individual developer's Eclipse editor by way of the sonar Eclipse plugin.
Same software. The name changed last year, from Sonar to SonarQube
http://www.sonarqube.org/sonar-becomes-the-sonarqube-platform/
From SonarQube
SonarQube (formerly Sonar) is an open source platform for continuous inspection of code quality.
From http://www.sonarqube.org/
SonarQube™ software (previously known as “Sonar”) is an open source project hosted at Codehaus.

How to upgrade offline instance of sonarqube plugins

I have an instance of sonar on a machine not connected to the internet.
Spent lots of time going through sonarqube doc but do not see anything that addresses this.
The documented method is to use the web server's update center but that seems to only look to the internet for supported/available plugins.
Java and Findbugs plugins are at 2.4 with the fresh install of sonar 4.5.1 and the java plugin that can be downloaded is (executable jar file) is 2.5.1, so I'd like to get as current as I can.
Follow these steps.
Check what plugin version is the latest for your instance on the plugin version matrix documentation page
Download all plugin jars you need (beware of dependencies) by following the download link on each plugin page
Put the jar(s) in the SONARQUBE_HOME/extensions/plugins directory
Stop SonarQube
Start SonarQube
This should do the job.

Configure SonarQube Eclipse plugin to visualize the results of analysis from Sonar plugin on Jenkins

I have a question regarding the setup and configuration of SonarQube plugin in Eclipse . We have Sonar plugin version 2.1 installed in Jenkins. It runs analysis every day and I want to configure the Eclipse plugin so that it displays the result from the Jenkins analysis. I don't know if this is possible because I can't find any information about this, the only hope comes from the first answer of this question.
PS. I apologize if there already is an answer to my question, I couldn't find it.
The Sonarqube eclipse plugin is able to present to you the results of your analysis you run with jenkins. The results your are looking for however, are stored in the sonarqube database. So you need to to configure the sonarqube eclipse plugin to connect to the sonarqube-server, not the jenkins-server.
Here is how you do the configuration:
http://docs.codehaus.org/display/SONAR/Configuring+SonarQube+in+Eclipse

SONAR Integrated with Eclipse

Am working on sonar integrated with eclipse using ant
But when i go "right click project-->configure-->associate with sonar" nothing happens!!
My ant version is 1.7.1
Eclipse is Helios(3.6)
sonar version is 3.4.1
Welcome all your favours..........
Sonar Eclipse has nothing to do with Ant, it's really independendent.
You should follow the different steps listed in the documentation page. Most notably, you need to have a Sonar server up and running somewhere (on your local computer or elsewhere) and you must make sure that you already launched an analysis of your project, which you can browse on Sonar Web application. If not, you'll never be able to associate your project in Eclipse.
Once you have a first analysis of your project on the Sonar server, then you need to configure the URL of your server in the Eclipse settings. Only after this, you'll be able to associate your project with Sonar.
This might have to do with your plugin version. As described in the docs Version 3.0 is only compatible with Eclipse 3.7 and up.
I would suggest you either upgrade your eclipse or you downgrade your plugin.