I'm trying to use Sonar to analyse my projects in Eclipse. I am currently using Maven in eclipse. I installed the Sonar Eclipse plugin as described in this link.
But when I try and associate my project with Sonar, I get an error saying:
project with key not found on server.
Am I missing some steps? I started the Sonar Server before connecting to eclipse. But nothing works.
I even tried following this article (Sonar plugin Eclipse) but to no avail.
Please help..The Sonar documentation is not descriptive at all making it very hard for beginners like me to understand.
You can not associate your project in Eclipse if you haven't first analysed it with Sonar (by running "mvn sonar:sonar" on your project).
Once your project has been succesfully analysed and that you can browse it in the Web UI (http://localhost:9000 by default), then you can try to associate your project within Eclipse and this will work.
Related
I am using the sonar ant task jar for sonar analysis so I setup it in the project-properties.xml and create an Ant build step in jenkins. When I build the job, the analysis works fine and I am able to see the results in the sonarqube server, but in jenkins no link to SonarQube is visible.
Do I really need to install the SonarQube plugin for the link to be visible for the job?
See also how to publish sonar result in jenkins server, or do we have sonar-report jenkins plugin
Normally you let SonarQube handle the code analysis on it's own and not by the Ant task (in the Jenkins job).
The Jenkins plug-in is there to trigger Sonar, to get latest sources (from the SCM) and run the analysis.
The results, are then made available on Sonar, but the Jenkins project, will provide a link to the results.
Workaround
There is (for as far as I know) no way to add a link, to an external generated report. What could be done, is add a simple HTML page, with a link to the Sonar server, to the project. And publish that simple HTML page, with the HTML Publisher Plugin.
I am trying to integrate sonarqube with eclipse to analyse simple java project.
But it is not happing. When we right click on simple java project and hit Configure-> Associate SonarQube, the window appear where field appear like Project and SonarQube project.
Project field is autopopulated with the java project you right clicked and What we need to enter in SonarQube project is not clear to me. Also no tab is appearing where we can do something like SonarQube -> Analyse.
(I have added sonaqqube plugin in eclipse and also set sonarqube server path to localhost:9000)
Please suggest.
The SonarQube Eclipse plugin lets you associate (and locally analyze) projects that have already been analyzed by other means (maven target, ant task, SonarQube runner). It is not meant as a way to launch persisted (shared) analyses.
So if you want to use the SonarQube Eclipse integration, please do a first analysis of your project, then try to associate it from Eclipse. This will allow you to synchronize the issues and perform local (preview) analyses.
[EDIT]
On recent (4.x) versions of SonarQube, you also have the option to provision your project on the server. This will allow you to associate your Eclipse project and perform preview analyses.
I am totally new to working with Maven in Eclipse. I am using the latest verion of Eclipse (Kepler). According other posts, as well as Eclipse's help page http://help.eclipse.org/kepler/index.jsp?topic=//org.eclipse.platform.doc.user/tasks/tasks-127.htm , I am supposed to try to install new software within Eclipse IDE.
However, when I try to Add Eclipse's recommended m2e release, Eclipse gives me an error:
Unable to read repository at http://download.eclipse.org/technology/m2e/releases.
download.eclipse[...]releases is not a valid repository location.
Essentially I run into the same problem no matter which approach I take outlined on the Eclipse help page. Is there some other/better way to integrate Maven with Eclipse? Are there steps I should have taken before this? All I have done so far is install Eclipse. How can I successfully get Maven running?
EDIT: Now I am using Java EE and still run into problems when making a Maven project. I get a "Could not resolve archetype error" could this be because I'm behind a proxy?
Most convenient option:
The reason you're getting that error is because that repo is deprecated, and it has been moved. Example of how the new repo looks:
http://download.eclipse.org/technology/m2e/releases/1.0/1.0.0.20110607-2117
Copy that in the Install New Software view, and you will see that it works.
Other options:
Install the Maven Integration from Eclipse Marketplace (Help -> Eclipse Marketplace)
Download the EE version of Kepler (comes with m2e)
Choose your own release (bottom of the page) and use the Install New Software view.
I had the same issue here and the above answer didnt work for me. Although Maven is installed I cane update my dependencies on my folder the way I used to be able to do on Juno. What I did was used the pom.xml from my current project and pasted it into the pom of my new project I created specifically in Eclipse using new project->Maven.
This was eclipse knows its a Maven project and allows my all the benefits of being one.
To install maven properly for eclipse you should set the correct repos as follow:
Help=>install=>
then work with
http://download.eclipse.org/releases/
example of eclipse version : mars or kepler ..
I have installed the sonar eclipse plugin in eclipse Juno. I put the groupid and the artifactid into the proper lines, however I get an error:
Unknown exception
How to configure the sonar plugin properly in eclipse?
You need to install Sonar on a server (or run it on your machine for testing). Then you need to configure it in the Eclipse properties and choose it from the drop-down in the associate with sonar dialog (unless it runs on your machine, in which case it is already available from the drop down).
Before you can associate a project with sonar, you need to run the sonar analysis on that project (usually using maven). Take a look at the sonar documentation to get more information.
Can I use Sonar plugin without others installations of Sonar ? I'm trying to use following the steps of sonar doc but it don't work. When I try to associate my projects the message "IDgroup empty" appears, and I can't connect when I try 'test connection'. Someone knows some better tutorial , or more specific? Thanks
You have to be running Sonar somewhere, localhost:9000 is fine. Then you have to do a build of this project using that Sonar. If you are using Maven, right click on the project -> Run As -> Maven build, and put in sonar:sonar as the Goal. This can also be done using Ant instead, but you will need a sonar target in your build.xml. Then when you do the "Associate with Sonar" dialog, if GroupId and ArtifactId are empty, type in the correct values in those columns.
To use the plugin you need a sonar sever somewhere. Do not hesitate to install the sonar server on your local machine if you do not have a central installation. It is very simple to setup the server for local testing/usage.
You need a sonar installation. Without it you won't be able to use the plugin.
The Sonar user guide should clarify this question. It is not possible to use the plugin without an running sonar instance anywhere. You need to install it somewhere an analyse the project once with the sonar runner, ant or maven.
After this procedure you are able to analyse your project locally. The reason for this precondition is the central configuration of Sonar.
Sonar User Guide (Configuring Sonar in Eclipse)