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.
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 upgraded my sonar version from 3.7 to 4.3.2. I understand from the release notes that alerts have been replaced with quality gates concept and when I log in to the dashboard, I do not see any quality profile that I had created before. I created a quality gate and set that as the default one.
On executing sonar from maven using sonar maven plugin, I get the following error - You must install a plugin that supports the language 'java'. I use the jacoco plugin to get multi module code coverage.
Is there any change that I need to do in my POM to get it running again?
This error occurs when installed plugins (directory extensions/plugins) are not copied before upgrading. Error logs will be improved in next versions.
Coming across "Sonar version 3.6 is required to perform local analysis" message
when try to use Sonar Local Analysis in eclipse.
I just installed latest from CodeHaus
where the Compatibility Matrix is saying it 3.6+.
I am using Eclipse: Juno 4.2, with following plugins installed:
Sonar Java Analyser 3.2.0.20130627-1142-RELEASE org.sonar.ide.eclipse.jdt.feature.feature.group SonarSource
Sonar m2e Connector 3.2.0.20130627-1142-RELEASE org.sonar.ide.eclipse.m2e.feature.feature.group SonarSource
Any ideas?
Are you running a sonarqube server?
I don't think you can use the plugin without the server running to connect to to do the analysis.
http://docs.sonarqube.org/display/SONAR/SonarQube+in+Eclipse
For the purposes you are looking at, I am assuming personal use, you could probably get away with the standalone instance of SonarQube, using the H2 embedded database.
Local Analysis Parameters
Parameters to configure local analysis can be set in various places. Here is the hierarchy of parameters:
Parameters defined in the SonarQube Web UI
Parameters set in the pom.xml file (for Maven projects only, with the
m2e connector installed) will override parameters defined in the UI
Parameters defined in Eclipse will override parameters defined in
the pom file (go to Window > Preferences > Sonar > Local analysis
properties)
Parameters defined at project level in Eclipse will override
parameters defined at Eclipse level (right click on the project and
go to Properties > Sonar > Local analysis properties)
Excluding Plugins
Some plugins (useless for a local analysis) can be skipped while performing a local analysis thanks to the sonar.dryRun.excludePlugins property (Settings > Configuration > General Settings > General).
The default value is 'devcockpit,pdfreport,report,scmactivity,views'. For example, to skip the Build Stability plugin (due to https://jira.codehaus.org/browse/SONARIDE-346), set the property to 'devcockpit,pdfreport,report,scmactivity,views,buildstability'.
Here is where I found this information: Running Sonar Qube In Eclipse
Double Check your settings
You might also want to double check your settings. The plugin will install the sonar instance for you for local analysis on localhost:9000. If you deleted this, this might be giving you the errors. You should have 2 servers listed on the config page, localhost, and your remote server
Refer back to this page too: Configuring Sonar With Eclipse
With Sonar plug-in 3.0 local analysis could be launched fine.
With Sonar plug-in 3.2 I get the same error as you.
Please choose "Install new software..." and enter URL :
http://dist.sonar-ide.codehaus.org/eclipse-archives/3.0.0/
I had the same problem because I updated the eclipse plugin but forgot to update the sonar-server (SonarQube).
After following the upgrade guide and installing SonarQube 3.6.2 it worked again.
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.
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)