Regarding issues reported by SonarLint On-The-Fly for one java file, I see a small subset of issues for the java file. As compared to the SQUID issues shown on SonarQube server for the same file.
I am using SonarQube server version 6.3, SonarLint 3.1.0.and Eclipse Neon.3. Sonarlint is connected to the server successfully and the eclipse project is linked to the project on SonarQube server. The project has component projects and this particular file is in an eclipse component project.
This squid:S1258 does not show in Sonarlint although present in the file; however this squid:S2293 shows on both Sonarlint and SonarQube.
Please advise
The Sonarlint plugin apparently does not utilize the project references to other projects in eclipse. Our applications are represented in multiple eclipse projects. The solution that seems to work is simply to associate each eclipse project to the same SonarQube server project.
I had the same problem, in my case these are the versions in use:
Eclipse Mars.2 (4.5.2)
SonarLint for Eclipse 3.2.0.xxxx
SonarQube Server 6.1
Linux RedHat 64 bit OS
Make sure your Eclipse project is bound to the remote SonaQube server project: sometimes the binding is lost or simply the auto bind feature fails with no warning.
Right click your Eclipse project -> SonarLint -> Bind to a SonarQube project
On the window that pops up verify the SonarQube server is selected, click on
Auto bind selected projects
check that remote bound project is correct and then click Finish.
You can repeat the procedure to verify the binding is still there.
You can apply the procedure to multiple projects at once, just select them before right-clicking.
I have project in my local machine but sonar server is on remote location. Is there any way to analysis my local project with remote sonar server.
I am using sonarLint plugin in my eclipse luna.
The most recent versions of SonarLint do not rely on a SonarQube server. It works completely offline as it include all necessary analyzers and settings.
Soon, it will be possible to connect it to a SonarQube server to use information from it, for example, quality profiles and resolved issues.
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.
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.
I have a project (built from an AppFuse template) that requires Maven 2.2.1. So I upgraded to this (from 2.1.0) and set my path and my M2_HOME and MAVEN_HOME env variables.
Then I ran mvn eclipse:eclipseand imported the project into Eclipse (Galileo).
However, in the problems list for the project (and at the top of the pom.xml GUI editor) it says:
Unable to build project
'/export/people/clegg/data/Workspace/funcserve/pom.xml;
it requires Maven version 2.2.1
This persists whether I set Eclipse to use its Embedded Maven implementation, or the external 2.2.1 installation, in the Preferences -> Maven -> Installations dialog.
I've tried closing and reopening the project, reindexing the repository, cleaning the project, restarting the IDE, logging out and back in again, everything I can think of! But Eclipse still won't believe I have Maven 2.2.1.
I just did a plugin update so I have the latest version of Maven Integration for Eclipse -- 0.9.8.200905041414.
Does anyone know how to convince Eclipse I really do have the right version of Maven? It's like it's recorded the previous version somewhere else and won't pay any attention to my changes :-(
Eclipse allows you to specify an external Maven installation. But there's a catch. :(
Have a look at Windows > Preferences > Maven > Installations.
You will see a message like this:
Note: Embedded runtime is always used for dependency resolution, but does
not use global settings when it is used to launch Maven.
To learn more, visit the maven web page.
Translating to English, it means that Eclipse will continue to employ its internal Maven instance in order to perform some tasks.
When you "Run As > maven install" it will run your pom.xml script employing the external Maven instance you specified but when Eclipse performs some of its internal stuff, it will continue to use the embedded Maven instance, whatever version it is.
(edited)
As far as I know, when you install M2Eclipse you are implicitly defining which "internal Maven instance" you will have, which is exactly that one packaged by the plugin.
In the plugin configuration, you can add external Maven instances by telling where they are installed.
If you are using a recent m2eclipse version, you can try this too:
<prerequisites>
<maven>>=2.2.1</maven>
</prerequisites>
Notice the greater than in >=2.2.1. It works fine for me.
A common source of trouble (of this kind) is if you change global preferences and don't remember or know that you have enabled some project specific settings. At least it's a chance that the global setting is now set to use the external maven but the project setting is still set to 'embedded'.
M2Eclipse uses an embedded maven instance, not the maven instance you have installed on your system.
Have you tried switching workspaces?
You can still reference the same project in the new workspace. This would provide about as much of a reset as you can do in terms of eclipses internal settings.
Try creating your eclipse project with mvn project:m2eclipse or use the maven import option under import project.
Using m2eclipse, my fallback in these situations is to do Maven > Update Dependencies and then Maven > Update Project Configuration. The first is just me being supersticious, but the second will rewrite .project and .classpath.
As Pascal says about, m2eclipse can also be pointed at an external instance. I've done this in the past, though not at 2.2.1.
Dan
I got the same issue. Resolved it by restarting the system because every time you change the 'Path' in environment variables you should restart the system or else if would not pick the changes.